【发布时间】:2021-02-23 16:29:31
【问题描述】:
我已经安装了 Angular 材质库,我面对的是找不到模块。 我可以知道任何解决方案吗?非常感谢。
material-module.ts
import { NgModule } from '@angular/core';
import { A11yModule } from '@angular/cdk/a11y';
...
import { MatTreeModule } from '@angular/material/tree';
import { OverlayModule } from '@angular/cdk/overlay';
@NgModule({
exports: [
A11yModule,
CdkStepperModule,
...
PortalModule,
ScrollingModule,
]
})
export class MaterialModule { }
app.module.ts
import { NgModule } from '@angular/core';
...
import { MaterialModule } from './library/material-module';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
BrowserModule,
...
MaterialModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
版本: "@angular/core": "~8.2.14", "@angular/material": "^8.2.3",
【问题讨论】:
-
能否请您检查一下材料模块的路径是否正确?
-
材质模块是你的自定义模块吗?
-
您好,路径是正确的,否则VS Code会出错。
标签: angular ionic-framework angular-material