Consider following example:
var ar = [4, 2, 3];
ar.$x = 'something';
var br = angular.copy(ar);
console.dir(br);
br
does not have $x
property any more, because when copying array, angular iterates with for (;;;)
which does not see custom properties (if it iterated with for in
then it would work).
Which of following shall I do?
- Create array like class and then assign property;
- If it's bug, report to angular;
- Change my code, because assigning property to array is not good practice;