Currently, I am facing an issue where I am assigning items to the scope like so:
$scope.items = [{
name: 'one',
value: 1
}{
name: 'two',
value: 2
}]
I am using ng-repeat
to display these items. There's a service that updates the data in this scope variable every few seconds. However, the problem is that each update causes a re-iteration. I attempted to use angular.forEach
to iterate through the existing data in the scope and the new data, updating values at corresponding keys. Unfortunately, this method does not seem to reflect the updated values that have already been iterated.
The constant re-iteration upon updates is causing issues with styles applied within a directive. The re-rendering process often overrides these style changes, making it quite inefficient as there may be only one or two items with actual updates. Does anyone have a viable solution for this dilemma?
Any help would be greatly appreciated!