あなたはこの
@Component({
selector: 'selector',
styles:[`div {background-color: blue;}`],
template: `
<div class="row " [@routerTransition]>
<h2>Component</h2>
</div>
`,
animations: [trigger('routerTransition', [
state('void', style({opacity: 1, height: 0})),
state('*', style({opacity: 1})),
transition('void => *', [
style({opacity: 0}),
animate('1s ease-in-out', style({opacity: 1}))
]),
transition('* => void', [
style({opacity: 1}),
animate('0.5s ease-in-out', style({opacity: 0}))
])
])]
})
export class YourComponent {
constructor() {}
}
を試すこと