component re-use in ngFor

12 views
Skip to first unread message

Dmitri Lemmerman

unread,
Oct 19, 2019, 8:37:36 AM10/19/19
to Angular and AngularJS discussion
i came across a situation in my angular application where an item in a list was mutated but i didn't want the DOM element to be recreated. i dug into the ngFor implementation a bit and it seemed that this was not possible. is my understanding correct here? that is, the component is always re-instantiated given a change in the list item as identified by ngTrackBy?

i added this code to the beginning of _applyChanges for my particular use-case (a single element in the list is mutated) https://gist.github.com/okhobb/6873e751f4e9959690aece852e502e3f but curious if perhaps a more general solution should be added to angular.
Reply all
Reply to author
Forward
0 new messages