Answer the question
In order to leave comments, you need to log in
AngularJS $scope and array - bug or feature?
I'm almost a complete zero in JS, but I got someone else's code and I have to poke around. Faced strange behavior (in my opinion this is a bug).
In the controller I do $scope.item = $scope.arrayFirst[i]
, then in the code - $scope.someArray.push($scope.item)
And so 20 iterations. So, in some conditions that I can’t trace, when pushing one of the items in the array, o_0 disappears, that is, its length becomes one less. So far I have solved the problem like this: $scope.item = angular.copy($scope.arrayFirst[i])
- it seems to work fine.
What could it be? Can angular somehow filter this array without my knowledge?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question