+2 votes
ago by
I in JS is almost a complete zero but got someone else's code and have to be picked. Faced with a strange behaviour (in my opinion this is a bug).
In the controller do
$scope.item = $scope.arrayFirst[i]
further code -
And so 20 iterations. So, in any conditions that I can't keep track of when Pushe one item in the array disappears o_0 , that is, its length becomes one less. The problem is decided so:
$scope.item = angular.copy($scope.arrayFirst[i])
- seems to work fine.
What could it be? Can angular somehow without my knowledge to filter this array?
ago by
This can not be. If You do not complicate, please do so at codepen.io billet what you do in a real project (of course, the relevant NDA and all that), will post a link here and I'll tell You where the error is.

1 Answer

0 votes
ago by
without my knowledge to filter this array?

no, but the array can be changed from another part of the system, for example if it it is forwarding to the Directive.
ago by
Stanislav Fateev hardly prosrochennoy in a Directive or service array will be called there as well. Debug steps
ago by
did a search on the name of the array throughout the code, the only place where it is used in addition to the controller (where there is no apparent filtering at all) is in the template in the ng-repeat items in the table are displayed
ago by
Alexander Marchenko in templates to search by name, if the array is only used in a ngrepeat that is a little more than strange. In General, Yes, better talkie set and see.