animation - Animate component out Angular 2 -


i want animate component in , out while navigating on site. have code:

@component ({     moduleid: module.id,     selector: 'animated-component',     template: '<div [@flyinout]="state"> animated section </div>',     animations: [     trigger('flyinout', [         state('in', style({transform: 'translatex(0)'})),         transition('void => *', [             style({transform: 'translatex(-100%)'}),             animate(1000)         ]),         transition('* => void', [             animate(100, style({transform: 'translatex(100%)'}))         ])      ])]    export class animatedcomponent {     public state : string;     constructor() {         this.state = "in";     } } 

the in animation works, when navigate other component, current component disapears instead of animate out. how can trigger void state correctly?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -