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?