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

后端 未结 8 1387
生来不讨喜
生来不讨喜 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:44

    If you face this error in Storybook, then do import this BrowserAnimationsModule to moduleMetadata in your story.
    Like this,

    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    
    
    export const Primary = () => ({
      template: `
       
    `, moduleMetadata: { imports: [AppModule, BrowserAnimationsModule], }, props: { data: SOME_DATA_CONSTANT, }, });

    PS: For Angular, answers that are mentioned above works well!

提交回复
热议问题