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

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

This comment has been minimized.

Show comment
Hide comment
@mhevery

mhevery May 23, 2012

Member

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

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 May 23, 2012

IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue May 23, 2012

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
@coli

This comment has been minimized.

Show comment
Hide comment
@coli

coli May 24, 2012

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

coli commented May 24, 2012

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

@mhevery

This comment has been minimized.

Show comment
Hide comment
@mhevery

mhevery May 24, 2012

Member

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.

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