我正在使用 Angular 9 和 Angular Material 9.2.4。
我正在尝试使用mat-tab-组在我的 component.html 中,但我不断收到错误
'mat-tab-group' is not a known element:
1. If 'mat-tab-group' is an Angular component, then verify that it is part of this module.
2. If 'mat-tab-group' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.ng(0)
我已经使用以下命令安装了 Angular 材料
ng add @angular/material
我的package.json如下:
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "^9.0.0",
"@angular/cdk": "^9.2.4",
"@angular/common": "~9.0.0",
"@angular/compiler": "~9.0.0",
"@angular/core": "~9.0.0",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "~9.0.0",
"@angular/platform-browser-dynamic": "~9.0.0",
"@ng-bootstrap/ng-bootstrap": "^6.0.0",
"@ng-select/ng-select": "^3.7.2",
"@nicky-lenaers/ngx-scroll-to": "^3.0.1",
"@types/chartist": "^0.9.47",
"angular-archwizard": "^5.0.0",
"angular-google-charts": "^1.1.4",
}
我已在我的 module.ts 中导入了 {MatTabsModule}
import {MatTabsModule} from '@angular/material/tabs'
...
..
@NgModule({
declarations: [
...
..],
imports: [
....
MatTabsModule,
....]
..
..
export class PagesModule {}
还是我用的时候
<mat-tab-group></mat-tab-group>
我收到顶部提到的错误。
我究竟做错了什么?