mat-tab-group在Angular 9中不是已知元素

时间:2020-07-20 17:03:36

标签: angular angular-material angular9

我将Angular 9与Angular Material 9.2.4一起使用。

我正在尝试在我的component.html中使用 mat-tab-group ,但我不断收到错误消息

'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",
    }

我已经将{MatTabsModule}导入了我的模块中。

import {MatTabsModule} from '@angular/material/tabs'

...
..
@NgModule({
declarations: [
...
..],
imports: [
 ....
MatTabsModule,
....]
..
..
export class PagesModule {}

我仍然使用时

<mat-tab-group></mat-tab-group>

我得到上面提到的错误。

我在做什么错了?

0 个答案:

没有答案