I have a select tag with a function call in ng-options:
<select ng-model='selectedList'
ng-options='list.id as list.label
for list in listService.computeLists(resume)'
>
that's causing a repeating infinite digest error.
angular.js:14525 Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Is there any way to have this function call in ng-options
without getting that error? I've tried memoizing but I couldn't get it to work.
This error occurs when the application's model becomes unstable and each
$digest
cycle triggers a state change and subsequent$digest
cycle. AngularJS detects this situation and prevents an infinite loop from causing the browser to become unresponsive.One common mistake is binding to a function which generates a new array every time it is called. For example:
The solution is to return the same array object if the elements have not changed.
For more information, see