简体   繁体   English

Angular 9 中带有图标的选项卡 - 材料

[英]Tabs with icons in Angular 9 - material

I am trying to use icons for the tab labels in angular 9 material.我正在尝试为 angular 9 材料中的标签标签使用图标。 When I do this, I get an error when I try to use the to set the icon I get the following error.当我这样做时,当我尝试使用 设置图标时出现错误,我收到以下错误。

error NG8001: 'mat-tab-label' is not a known element: 1. If 'mat-tab-label' is an Angular component, then verify that it is part of this module.错误 NG8001:'mat-tab-label' 不是已知元素: 1. 如果 'mat-tab-label' 是 Angular 组件,则验证它是该模块的一部分。 2. If 'mat-tab-label' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. 2. 如果“mat-tab-label”是 Web 组件,则将“CUSTOM_ELEMENTS_SCHEMA”添加到该组件的“@NgModule.schemas”以禁止显示此消息。

Any suggestions on how to do this?关于如何做到这一点的任何建议?

Did you import import {MatTabsModule} from '@angular/material/tabs';您是否import {MatTabsModule} from '@angular/material/tabs'; to app.modules.ts?到 app.modules.ts?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM