0

I try to call $http function in my controller from my template.

Here is template:

   <tr ng-repeat-end>
      <td>
         <span>Posted {{list.getDamageEvents(soData.damagesId)}}</span>
      </td>
   </tr>

Here function in controller:

self.getDamageEvents = function (reviewsId) {
    var result;
    $http.get(config.baseUrl + "api/DamageEvent/GetEventsByReviewsId/" + reviewsId).then(function (result) {
        result = result.data;
    });
    return result;
}

And here the error I get in browser:

Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []

Any idea why I get error above and how to fix it?

Michael
  • 13,950
  • 57
  • 145
  • 288
  • You may want to look at: [Error: 10 $digest() iterations reached.](http://stackoverflow.com/questions/14376879/error-10-digest-iterations-reached-aborting-with-dynamic-sortby-predicate) – Emile Bergeron Jul 26 '16 at 15:54

1 Answers1

0

Can u call this method from controller and save result into $scope?

And then use this $scope variable in template?

uamanager
  • 1,128
  • 8
  • 11