[英]AngularJS: Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached
I have a nested array which I am ng-repeating on the page. 我在页面上重复执行了一个嵌套数组。 By looking at the page, everything I want to show on the screen is rendered, however in the console I get the error:
通过查看页面,我想在屏幕上显示的所有内容均已呈现,但是在控制台中却出现错误:
Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
I assumed that this error occurs due to the amount of nested array's I have because once I make the size of my nested array smaller, the error doesn't appear. 我假定此错误是由于嵌套数组的数量而发生的,因为一旦我减小了嵌套数组的大小,该错误就不会出现。
So I finally solved the issue. 所以我终于解决了这个问题。 What I ended up doing was adding a library called Recursion Helper to my project, and injected it as a dependency.
我最终要做的是在项目中添加了一个名为Recursion Helper的库,并将其作为依赖项注入。
Here is a link to the original post. 这是原始帖子的链接 。 Thanks!
谢谢!
It is a known AngularJS issue. 这是一个已知的AngularJS问题。 AngularJS itself prevents to many iterations to avoid infinite loops.
AngularJS本身可以防止进行多次迭代来避免无限循环。
There is a possible workaround but it can harm other parts of your code: 有一个可能的解决方法,但它可能会损害代码的其他部分:
$rootScopeProvider.digestTtl(15);
This changes the limit of the ten iterations to fifteen or whatever number you would like to. 这会将十次迭代的限制更改为十五次或任意数量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.