Scenario
I have a dataset structured like:
[{
xRatio: 0.2,
yRatio: 0.1,
value: 15
}, {
xRatio: 0.6,
yRatio: -0.3,
value: 8
}]
I need to convert this data into absolute values for display in a ng-repeat
. However, when I attempt to do so using a converter function within the ng-repeat
, Angular gets caught in an infinite loop due to the function returning a new collection each time it is called.
The HTML code snippet is as follows:
<div ng-repeat="result in results">
<div>
<heat-map data="convertResult(result)"></heat-map>
</div>
</div>
The heatmap directive is responsible for rendering and displaying the data.
My query is: How can I manage this situation without cluttering the original dataset with the converted values?
Additionally, I would like the capability to remove items from both the converted and original collections.