ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Error when using ng-repeat on an array of objects.

Open halloffame opened this issue 12 years ago • 6 comments

http://codepen.io/anon/pen/BkgwE

It should loop through just once, but instead it keeps going back and looping through the array again and again, until it stops because it reaches too many digest iterations. When i stop including 'ionic' into the app it starts working normally.

Here is the error I am getting.

Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $watchCollectionWatch; newVal: 9; oldVal: 8","fn: function (context) {
          .......... lots of stuff .........
http://errors.angularjs.org/1.2.25/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3…20%7D%3B%20newVal%3A%20%5C%22123%5C%22%3B%20oldVal%3A%20undefined%22%5D%5D ionic.bundle.js:20433

halloffame avatar Oct 30 '14 05:10 halloffame

It seems to also be doing the same thing when using ng-repeat on a nested array.

http://jsfiddle.net/556GL/23/

halloffame avatar Oct 30 '14 06:10 halloffame

Hey @halloffame, so I've traced the problem back to to Angular 1.2ish - see this codepen and comment out the different angular / Ionic libs. Angular 1.3 works, Ionic and Angular (standalone) 1.2.17 fail. Note - Ionic bower will try to use Angular 1.2.17 at the moment.

So that explains the infinite digest error, but strangely Ionic and Angular 1.2.17 handle this error differently. Ionic is attempting to render the infinite list, where as Angular 1.2.17 standalone catches the error on the first iteration.

Anyway, I'll look in to this some more tomorrow, thanks for pointing it out.

drewrygh avatar Oct 30 '14 17:10 drewrygh

Great thanks! What is the timeline for Angular 1.3 support?

halloffame avatar Oct 31 '14 23:10 halloffame

Greetings @halloffame!

I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen it and include any examples and other necessary information, so that we can look into it further.

Thank you for allowing me to assist you.

Ionitron avatar Feb 01 '15 09:02 Ionitron

Thanks! It looks like this was fixed in 1.0.0-beta.14 http://jsfiddle.net/556GL/36/

halloffame avatar Feb 12 '15 23:02 halloffame

i am getting this is safari console from simulator ==> Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [] http://errors.angularjs.org/1.3.13/$rootScope/infdig?p0=10&p1=%5B%5

$ ionic info Cordova CLI: 5.2.0 Ionic CLI Version: 1.6.4 Ionic App Lib Version: 0.3.8 ios-deploy version: 1.7.0 ios-sim version: 4.1.1 OS: Mac OS X Yosemite Node Version: v0.12.7 Xcode version: Xcode 7.0 Build version 7A176x

ituhin avatar Aug 26 '15 21:08 ituhin