I need to animate an ngFor
list as it is populated and shown. Each element should have a transition, let's say something like this.
How can I do that?
I need to animate an ngFor
list as it is populated and shown. Each element should have a transition, let's say something like this.
How can I do that?
It has a few issues because
ngFor
does a few redundant add/removes which cause items to be animated which shouldn't:Plunker example (RC.x) from https://github.com/angular/angular/issues/7239 demonstrates the issue.
Update
This was fixed a long time ago
working Plunker example (2.4.x)
There is now the guide to Angular's animation system. This helps if we want to do fancy things, like only do the animation for elements added after the component has initialized, not the ones that are present already. I've modified the previous answer to do it the Angular 2 way.
Plunker: http://plnkr.co/edit/NAs05FiAVTlUjDOZfEsF?p=preview