简体   繁体   English

AngularJS:未捕获的错误:[$ rootScope:infdig]达到10个$ digest()迭代

[英]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. 我假定此错误是由于嵌套数组的数量而发生的,因为一旦我减小了嵌套数组的大小,该错误就不会出现。

Here is a fiddle that models my situation 这是模仿我情况的小提琴

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. 这会将十次迭代的限制更改为十五次或任意数量。

http://jsfiddle.net/NP7P5/33/ http://jsfiddle.net/NP7P5/33/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AngularJS错误:$ rootScope:infdig无限$ digest循环:达到10个$ digest()迭代。 流产! 观察者在最近5次迭代中被解雇:[] - AngularJS Error: $rootScope:infdig Infinite $digest Loop: 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [] JavaScript运行时错误:[$ rootScope:infdig]达到10个$ digest()迭代。 流产! 观察者在最近5次迭代中被解雇:[] - JavaScript runtime error:[$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [] JavaScript运行时错误:[$ rootScope:infdig]达到10个$ digest()迭代。 流产! 观察者在最近5次迭代中被解雇:[] - JavaScript runtime error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [] $ rootScope:infdig达到10个$ digest()迭代。 堕胎 - $rootScope:infdig 10 $digest() iterations reached. Aborting Array.sort角度滤镜和“错误:[$ rootScope:infdig]达到10个$ digest()迭代。 中止!” - Array.sort angular filter and “Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!” app.min.js:7错误:[$ rootScope:infdig]达到10个$ digest()迭代。 流产! 观察者在最近5次迭代中被解雇 - app.min.js:7 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations angular.js:10126错误:[$ rootScope:infdig]达到10个$ digest()迭代。 流产! nvd3 js错误 - angular.js:10126 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! error with nvd3 js dxDataGrid使用ngResource触发所有类型的Web API的无限调用(错误:[$ rootScope:infdig]达到10个$ digest()迭代。正在中止!) - dxDataGrid trigger infinite call on web api of all type with ngResource (Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!) 要在给定的时间间隔后动态打印字母,错误:[$ rootScope:infdig]已达到10个$ digest()迭代。 流产!(…) - want to dynamically print letters after a given interval of time, Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!(…) AngularJS:未捕获错误:[$ rootScope:infdig] - AngularJS: Uncaught Error: [$rootScope:infdig]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM