title: angularjs ng-repeat callback function
body: <p>is there a way to have a callback issued for each repetition of an ng-repeat. I have a collection which is filtered, and would need to modify the text dynamically every time an item is shown. If not possible, are there any workarounds?</p>
  
  <pre><code>&lt;span ng-repeat="item in items|myfilter"&gt;
      &lt;div nonexisting-ng-repeat-callback="getTextFromServer({{item.id}})"&gt;&lt;/div&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>When I try the following:</p>
  
  <pre><code>&lt;span ng-repeat="item in items|myfilter"&gt;
      &lt;div ng-style="{{item.style}}" ng-init="getTextFromServer(item)"&gt;&lt;/div&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>with this in the $scope</p>
  
  <pre><code>$scope.getColor = function (item) {
      var data = item.percentageComplete;
      if (data == 100) {
          return {
              color: "green"
          };
      } else {
          return {
              color: "orange"
          };
      }
  };
  
  $scope.getTextFromServer = function (item) {
          $http({
              method: 'GET',
              url: '/mypage',
              params : {"uri" : item.Url +"&amp;Result=Percentage"}
          }).
          success(function (data, status, headers, config) {
              item.percentageComplete = data;
              item.style = $scope.getColor(item);
          }).
          error(function (data, status, headers, config) {
              console.log(data + " - " + status);
              item.percentageComplete = undefined;
              item.style = $scope.getColor(item);
          });
  };
  </code></pre>
  
  <p>the getTextFromServer is called, but the ng-style is not updated when the http call returns.</p>
  
  <p>Regards,
  Leen</p>