I'm trying to develop the first animation in an Angular 5 app and it doesn't work. What I've done till now in detail:
- app.module.ts
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
imports: [
BrowserModule,
...
BrowserAnimationsModule,
...
In my component:
import { trigger,style,transition,animate,keyframes,query,stagger } from '@angular/animations';
animations: [
trigger('slideOut', [
transition('* => void', [
style({height: '*'}),
animate('2000ms ease-out', style({height: 0})),
])
])
]
Here is the template:
<div [@slideOut] class="alert alert-success alert-dismissible fade in" role="alert">
<button type="button" class="close"><span aria-hidden="true">×</span></button>
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
All is good!
</div>
Any idea what I'm missing here ? Do I need to install something?