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 -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -