0

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:

  1. 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">&times;</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?

Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84
user2304483
  • 1,462
  • 6
  • 28
  • 50

0 Answers0