This is a common problem:
5 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
The documentation (https://docs.angularjs.org/error/$rootScope/infdig) explains what NOT to do to avoid the situation.
However, once in a while, you end up in the situation anyway. And for a project larger than a toy app, finding the cause of the infinite digest loop can be really hard.
I'm looking for debugging hints on how I can find out where the code is located which causes the loop.
question was already answered here - How to Troubleshoot Angular "10 $digest() iterations reached" Error
as a resume of two best answers:
plus
you can always put conditional breakpoint here https://github.com/angular/angular.js/blob/c3220325a0a95484724a03bedca24e1bbf05dc80/src/ng/rootScope.js#L815 to check the exception stacktrace.
There can be multiple reasons to it. One of the common reason I've faced is due to a filter in the ng-repeat
which returns a new array to work on the ng-repeat
.
So check your ng-repeat
expressions which have associated filters which is modifying the array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With