title: Error: 10 $digest() iterations reached. Aborting! with dynamic sortby predicate
body: <p>I have the following code which repeats and displays the name of the user and his score:</p>
  
  <pre><code>&lt;div ng-controller="AngularCtrl" ng-app&gt;
    &lt;div ng-repeat="user in users | orderBy:predicate:reverse | limitTo:10"&gt;
      &lt;div ng-init="user.score=user.id+1"&gt;
          {{user.name}} and {{user.score}}
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the corresponding angular controller.</p>
  
  <pre><code>function AngularCtrl($scope) {
      $scope.predicate = 'score';
      $scope.reverse = true;
      $scope.users = [{id: 1, name: 'John'}, {id: 2, name: 'Ken'}, {id: 3, name: 'smith'}, {id: 4, name: 'kevin'}, {id: 5, name: 'bob'}, {id: 6, name: 'Dev'}, {id: 7, name: 'Joe'}, {id: 8, name: 'kevin'}, {id: 9, name: 'John'}, {id: 10, name: 'Ken'}, {id: 11, name: 'John'}, {id: 1, name: 'John'}, {id: 2, name: 'Ken'}, {id: 3, name: 'smith'}, {id: 4, name: 'kevin'}, {id: 5, name: 'bob'}, {id: 6, name: 'Dev'}, {id: 7, name: 'Joe'}, {id: 8, name: 'kevin'}, {id: 9, name: 'John'}, {id: 10, name: 'Ken'}]
  }
  </code></pre>
  
  <p>When I run the above code, I get the <strong>Error: 10 $digest() iterations reached. Aborting!</strong> error in my console. </p>
  
  <p>I have created <a href="http://jsfiddle.net/JSWorld/7ecYd/1/" rel="noreferrer">jsfiddle</a> for same. </p>
  
  <p>The sort predicate is being initialized only inside the ng-repeat and also the limit is being applied on the number of objects. so I feel having both the sortby and limitTo watchers together is the reason for error.</p>
  
  <p>If the $scope.reverse is false (ascending order of score), then it does not error.</p>
  
  <p>Can anyone help me understand what is wrong here? Much appreciate your help.</p>