title: Function calls to controllers under AngularJS ng-repeat become infinite
body: <p>I am just trying to get some proof of concept working for AngularJS.
  In the below code, the call to getClass is going to an infinite loop for some reason.
  The scope variable noOfCalls is set to increment in the function.
  My expectation was Angular to call this function once for every iteration. Anyone can help?</p>
  
  <p>Plunker link
  <a href="http://plnkr.co/edit/7QvkSEQGTJtExwYm9kgD?p=preview" rel="nofollow">http://plnkr.co/edit/7QvkSEQGTJtExwYm9kgD?p=preview</a></p>
  
  <p>HTML</p>
  
  <pre><code>&lt;body ng-controller="MainCtrl"&gt;
  &lt;h1&gt;Total number of calls: {{noOfCalls}}&lt;/h1&gt;
  &lt;div class="container" ng-repeat="item in arraydata"&gt;
  &lt;div class="form-group"&gt;
  &lt;input type="text" class={{getClass(item)}} ng-model=item.name /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>var app = angular.module('angularjs-starter', []);
  
  app.controller('MainCtrl', function($scope) {
     $scope.arraydata = [];
     $scope.arraydata.push({id:1, name: "test1"});
     $scope.arraydata.push({id:2, name: "test2"});
     $scope.arraydata.push({id:3, name: "test3"});
     $scope.noOfCalls=0;
  
     $scope.getClass = function(item)
     {
      $scope.noOfCalls+=1;
      return("form-control");
      }
  });
  </code></pre>