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 has been archived by the owner on Apr 12, 2024. It is now read-only.
You're going to have problems with this because of the instability of the model. You need to return the same array twice in a row to stop the digest from running again, and that's not going to happen like this.
Random orderBy sorting works smoothly in angular 1.1.1. It works in 1.2.x as well but generates infdig errors in the console.
http://jsfiddle.net/mblase75/jVs27/
JS:
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.list = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
$scope.random = function() {
return 0.5 - Math.random();
}
}
error in console:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $watchCollectionWatch; newVal: 44; oldVal: 39"],["fn: $watchCollectionWatch; newVal: 49; oldVal: 44"],["fn: $watchCollectionWatch; newVal: 54; oldVal: 49"],["fn: $watchCollectionWatch; newVal: 61; oldVal: 54"],["fn: $watchCollectionWatch; newVal: 67; oldVal: 61"]]
http://errors.angularjs.org/1.2.11/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3…20%24watchCollectionWatch%3B%20newVal%3A%2067%3B%20oldVal%3A%2061%22%5D%5D
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:78:12
at Scope.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:11853:19)
at Scope.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:12067:24)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:1302:15
at Object.invoke (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:3707:17)
at doBootstrap (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:1300:14)
at bootstrap (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:1314:12)
at angularInit (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:1263:5)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:20752:5
at HTMLDocument.trigger (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js:2342:7)
The text was updated successfully, but these errors were encountered: