javascript - ngRepeat track by: How to add event hook on model change? -
i have simple ngrepeat following: <some-element ng-repeat="singlerecord in arrayofrecords track singlerecord.id"> <!-- stuff --> </some-element> arrayofrecords updated server , may contain new data. ngrepeat 's track by feature can figure out when new element added array , automatically updates dom without changing existing elements. hook code , execute callback function when there's new data coming in or old data removed. possible via angular? from understand, there's $$watchers triggers callbacks whenever there's changes variables, don't know how go hacking that. right direction? note: know can manually save arrayofrecords , compare new values when fetch them see changed. however, since angular offers track by feature has logic, nice if can have angular automatically trigger event callback when element added or removed array. doesn't make sense duplicate logic exists in angular. probably create dire...