Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 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
Member

@mhevery 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 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 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
Member

@mhevery 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.