I saw a lot of questions about the order in which ng-repeat ends compared to other directives or things happening on the Angular ground, but I could not find an answer to how exactly it does this.
I have two ideas on how this might work.
The first way: When the ng-repeat trigger tracks, it deletes all elements created from the DOM, then creates all new elements in their place, even if many of these elements are the same (for example, in the case of 1 element added to the substitution array).
The second way:. Since ng-repeat already tracks which items come with items in its collection, it simply removes items that no longer exist in the collection, and creates new items for items that are new to the collection.
What is this and why?
source share