Angularjs 10 $digest() Iterations Reached
I have code like this: $scope.flags = []; $scope.$watch('selectedFilter', function() { for (var i = 0; i < 2; i++) { $scope.flags.push(i);
Solution 1:
One thing I want to point out is when you watch the change of a list, you should set the 3rd parameter to true
.
$scope.$watch('flags', function (oldval, newval) {
if (oldval != newval) {
console.log("hello");
}
}, true);
Post a Comment for "Angularjs 10 $digest() Iterations Reached"