Animate Adding and Removing Angular Elements with ngIf

Share this video with your friends

Send Tweet

A common use-case for an Angular animation is to animate an element into the DOM. This is achieved with a combination of ngIf and the “void” state so that you have complete control over how the element appears and how it leaves.

Eric Babin
Eric Babin
~ 8 years ago

Just an FYI, the plunk doesn't seem to be working at the moment.

izdb
izdb
~ 8 years ago

Is there a way to use this method when the ngIf contains a router-outlet? Seems to break routing making the whole animation system unusable

faye
faye
~ 4 years ago

How can I do something similar when the ngIf is placed on a child component. I have an issue where the animation works on enter, but not on leave.