Type LayoutModule does not have 'ɵmod' property
fivemin 10/22/2021 Angular
在使用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)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
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 { }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20