index.html
<div ng-repeat="object in objects" ng-style="getStyle(object.id)"></div>
controller.js
[...]
$scope.startWidth = 100;
$scope.getObject = [...]
$scope.getStyle = function(id) {
var widthVal = $scope.startWidth;
$scope.startWidth += $scope.getObject(id).value;
return { width : widthVal }
}
[...]
Encountering an issue with an infinite $digest loop in this code snippet. The reason is understood - the return value should not be dynamic. Is there a way to prevent this loop without sacrificing functionality? The objective is to display objects with varying width, where the width of an object is dependent on the value of the preceding object.