使用</mat-sidenav>标签会报错

来源:2-3 Material介绍

帅气的程序员

2019-09-14

Error: Found the synthetic listener @transform.start. Please include either “BrowserAnimationsModule” or “NoopAnimationsModule” in your application.

导入了 BrowserAnimationsModule 模块后 报错
Cannot read property ‘runOutsideAngular’ of undefined
是什么原因呢 百度了很久没找到原因,老师可以帮我分析下吗

图片描述

写回答

2回答

宝慕林9269512

2020-10-02

先确认你已经安装了 @angular/animations,然后在 app.module.ts 当中引入:

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

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


0
0

接灰的电子产品

2019-09-14

把 tsconfig.json 的 target 改成 es5

0
0

Angular打造企业级协作平台,让你在Angular领域中出类拔萃

全网首个介绍官方 Material 组件库用法与 Redux 在 Angular 中的应用

998 学习 · 536 问题

查看课程