You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When ng-bind is used, and the expression includes a filter that returns an array, angular enters an infinite digest loop and eventually cuts out after the 10 digest limit. I looked at the source and the issue is caused by the fact that ng-bind never uses object equality (angular.equals) to compare the new value and the old value in the watcher, rather since the filter is returning a new array, the old array is never equal and an infinite digest loop is caused.
The same expression will work if you use double curlies for binding rather than ng-bind
The alternative would be to convert the array to a string within ngbind and
compare the string values. Thereby behavior whenever curly brackets is
angular.equals so ngbind should probably match.
On Oct 22, 2014 9:27 AM, "Narretz" notifications@github.com wrote:
Interesting. angular.equals() might be too expensive, though.
—
Reply to this email directly or view it on GitHub #9717 (comment).
When ng-bind is used, and the expression includes a filter that returns an array, angular enters an infinite digest loop and eventually cuts out after the 10 digest limit. I looked at the source and the issue is caused by the fact that ng-bind never uses object equality (angular.equals) to compare the new value and the old value in the watcher, rather since the filter is returning a new array, the old array is never equal and an infinite digest loop is caused.
The same expression will work if you use double curlies for binding rather than ng-bind
See plnkr which shows the bug in action.
http://plnkr.co/edit/t6B3uz
The text was updated successfully, but these errors were encountered: