【问题标题】:After Importing the "Browser animation module in **Module.ts** file ( by running **npm install** @angular/animations)在 **Module.ts** 文件中导入“浏览器动画模块”后(通过运行 **npm install** @angular/animations)
【发布时间】:2020-05-28 18:07:28
【问题描述】:

Module.ts文件中导入“BrowserAnimationModule”后(通过运行npm install@angular/animations)

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

@NgModule({
  ...,
  imports: [
    ...,
    BrowserAnimationsModule
  ],
  ...
})

仍然是它的节目

错误:找到合成属性@animate。请包括“BrowserAnimationsModule”或“NoopAnimationsModule” 应用程序

在检查->控制台

ERROR Error: Found the synthetic property @animate. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
    at checkNoSyntheticProp (platform-browser.js:2088)
    at DefaultDomRenderer2.setProperty (platform-browser.js:2052)
    at BaseAnimationRenderer.setProperty (animations.js:501)
    at DebugRenderer2.setProperty (core.js:40022)
    at setElementProperty (core.js:37214)
    at checkAndUpdateElementValue (core.js:37124)
    at checkAndUpdateElementInline (core.js:37052)
    at checkAndUpdateNodeInline (core.js:38468)
    at checkAndUpdateNode (core.js:38411)
    at debugCheckAndUpdateNode (core.js:39433)

【问题讨论】:

    标签: angular8 angular-animations


    【解决方案1】:

    BrowserAnimationsModule必须在应用主模块app.module.ts中导入,导入后需要重启应用才能使导入的模块被识别。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 2020-01-30
      相关资源
      最近更新 更多