Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

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

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

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

coli opened this issue May 22, 2012 · 3 comments

Comments

@coli
Copy link

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
Copy link
Contributor

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 as completed May 23, 2012
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue May 23, 2012
When $digest() throws infinite digest exception it
does not properly clear the $phase leaving the scope
in an inconsistent state.

Closes angular#979
@coli
Copy link
Author

coli commented May 24, 2012

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

@mhevery
Copy link
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants