在使用angular框架整合官方组件库时报错
报错:

Uncaught Error: Type LayoutModule does not have 'ɵmod' property.
at getNgModuleDef (core.js:1119)
at recurse (core.js:25273)
at recurse (core.js:25284)
at recurse (core.js:25284)
at recurse (core.js:25284)
at registerNgModuleType (core.js:25269)
at new NgModuleFactory$1 (core.js:25383)
at compileNgModuleFactory__POST_R3__ (core.js:29082)
at PlatformRef.bootstrapModule (core.js:29332)
at Module.3290 (main.ts:11)

解决方法:

//引入BrowserAnimationsModule,如下示例

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatButtonToggleModule} from '@angular/material/button-toggle';

@NgModule({
  declarations: [],
  imports: [
    CommonModule,
    BrowserAnimationsModule,
    MatButtonToggleModule
  ],
  exports: [
    CommonModule,
    BrowserAnimationsModule,
    MatButtonToggleModule
  ]
})
export class ShareModule { }
最后修改:2021 年 10 月 22 日
如果觉得我的文章对你有用,请随意赞赏