SpaceFozzyon Stack Overflow • Recommends
On “Angular 2 "slide in animation" of a routed component”
With Angular 4.1 it is now possible to create specific route animations. This is different from triggering an animation when a component is displayed because it will let you animate the entering/leaving component at the same time for a smooth transition, and let you modify the transition depending on which component is coming or going. That means you can do complex transitions like slide a component in from the right if you're drilling down into content, and slide it in from the left if you're entering it via a 'back' button from another component.
First, annotate your router outlet like so (eg. app.component.html ):
<div class="page" @routerAnimations="prepareRouteTransition(outlet)"…