Debugging $rootScope:infdig

后端 未结 4 1196
既然无缘
既然无缘 2021-02-13 17:58

This is a common problem:

5 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []

The docume

4条回答
  •  醉梦人生
    2021-02-13 18:31

    question was already answered here - How to Troubleshoot Angular "10 $digest() iterations reached" Error

    as a resume of two best answers:

    1. remove all suspicious HTML - basically remove all your html from the template, and check if there are no warnings (https://stackoverflow.com/a/17129274/274500)
    2. usually it happens when function returns an new object (https://stackoverflow.com/a/17116322/274500)

    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.

提交回复
热议问题