Found the synthetic property @enterAnimation. Please include either “BrowserAnimationsModule” or “NoopAnimationsModule” in your application. Angular4

后端 未结 8 1338
生来不讨喜
生来不讨喜 2020-12-30 18:21

When running Karma to test my Angular4 application, I get this error Found the synthetic property @enterAnimation. Please include either \"BrowserAnimationsModule\" o

相关标签:
8条回答
  • 2020-12-30 18:50

    Future readers: you can also get this exact error, when you forget to place

    animations: [ <yourAnimationMethod()> ]
    

    on your @Component ts file.

    that is if you're using [@yourAnimationMethod] on the HTML template.

    0 讨论(0)
  • 2020-12-30 19:00

    This should work.

    1- Import BrowserAnimationsModule in app.module.ts

    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    

    2 - Add to imports in app.module.ts

    imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    routing,
    Ng2SmartTableModule,
    TreeModule,
    BrowserAnimationsModule]
    
    0 讨论(0)
提交回复
热议问题