I'm doing a ng-repeat over a list returned by a function declared in the controller and I'm getting "10 $digest() iterations reached. Aborting!" message.
<div ng-repeat element in list()></div>
The function:
MyCtrl = ($scope)->
...
$scope.list = ->
list = {}
for e in someArray
.... #adding stuff to list
list
...
I discovered the problem is the $scope.list() function is being called several times and each time the function is called the local list variable is re-assigned so angular sees a different object each time and the ngRepeat element is redrawn. How can I avoid this?