So I have an array structure like so:
const array = [
{
key: 'xxx1',
data: [
{
key: 'yyy1',
//...
propThatWillChangeOverTime: 'foo'
},
//...
]
},
//...
]
In the html where I print the above array struture, I opted to use two ng-repeat
(nested) and, to gain performance, used track by
on both of them, something like:
<div ng-repeat="parent in array track by parent.key">
<div ng-repeat="child in parent.data track by child.key">
(...)
<custom-angular-component
child="child">
</custom-angular-component>
(...)
</div>
</div>
custom-angular-component bindings: child: '='
Now, propThatWillChangeOverTime
will (like the name says) change over time, however it never has the value updated. If I remove the first track by, the value updates. However this is something I can't do, as it will have a negative effect on other components.
Is there a way to watch the property I want to "do something with when its value changes"?