r/angularjs • • Aug 22 '15

[ENG] Tutorial AngularJs: how to deal with duplicates in ngRepeat by using the track by option

https://www.youtube.com/watch?v=1kmFfRwI2KY
1 Upvotes

1 comment sorted by

1

u/nishant198885 Dec 20 '22

AngularJS, orders like ng-rehash monitor every one of the components to limit the DOM creation. That is accomplished by storing the object instance each time a new collection element is added. Angular doesn't redraw the entire set of elements; it simply delivers the new component.

When ng-repeats is used with an object that has a unique identifier, that identifier should be used for tracking, not the object instance. Consider the code below.

Visit Now-Jai infoway