1

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

AlvinJ
  • 261
  • 4
  • 7
  • 20

2 Answers2

2

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.

Here is a link to the original post. Thanks!

Community
  • 1
  • 1
AlvinJ
  • 261
  • 4
  • 7
  • 20
0

It is a known AngularJS issue. AngularJS itself prevents to many iterations to avoid infinite loops.

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/

Michael
  • 3,308
  • 5
  • 24
  • 36
  • Thanks for the answer, however like you said, not too sure if doing this would be the best solution. Thanks for the answer! – AlvinJ Nov 05 '14 at 05:41
  • You welcome! According to this: https://github.com/angular/angular.js/issues/6440 It seems like there are not so much solutions to this – Michael Nov 05 '14 at 08:02