Error: $digest already in progress when repeater bind to function? #979

Closed
coli opened this Issue May 22, 2012 · 3 comments

Projects

None yet

2 participants

@coli
coli commented May 22, 2012

http://jsfiddle.net/ADukg/135/

Not sure what is going on here, if you click the Test button, you'll see "Error: $digest already in progress"

Something about <tr ng-repeat="row in getRows(tableState)"> seem to cause this.

Also, why is getRows() called 11 times per click of the Test button?

@mhevery
Member
mhevery commented May 23, 2012

This throws too many iterations exceptions which then leaves the scope in inconsistent state. The exception got eaten and so it was never shown. The already in progress is a symptom of the original bug

fix: #982

@mhevery mhevery closed this in 5989a1e May 23, 2012
@IgorMinar IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue May 23, 2012
@mhevery mhevery fix($rootScope): TTL exception does not clear $$phase
When $digest() throws infinite digest exception it
does not properly clear the $phase leaving the scope
in an inconsistent state.

Closes #979
989446e
@coli
coli commented May 24, 2012

Hi, I guess the second question is then, why would the above example trigger an infinite loop?

@mhevery
Member
mhevery commented May 24, 2012

ng-repeat requires stable array elements. Which means that every time you look at the array, the array element have to be same instances. in your case you create a new instance on each iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment