Animate Adding and Removing Angular Elements with ngIf

InstructorJohn Lindquist

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
~ 4 years ago

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

~ 4 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

~ 9 months 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.