Friday 22 February 2019

Angular: How to animate just changed items in a continuously read & overwritten list

I have a simple

*ngFor="let item of list;

in my template. And an "ADD" button, which opens a form as a modal dialog, and user can add new items to the list.

After user clicks "SAVE" on modal, the model will be closed. After that, in order to always show the most current data (i.e. in a multi-tab case), we load all the items from backend again, and we set the list again:

 this.list = ....

In this case all the items will be animated again, and not just the new one (or the changed ones), since Angular thinks they are all new items. How can i animate just the new & changed items?

I know i can look for a change in my list, remove and re-add the changed ones in list manually. But i am looking for a simpler way (maybe angular built-in), which automatically detects and does not replace the old items.



from Angular: How to animate just changed items in a continuously read & overwritten list

No comments:

Post a Comment