我的 Angular 材质出现错误:
compiler.js:466 Uncaught Error: Template parse errors:
'mat-label' is not a known element:
1. If 'mat-label' is an Angular component, then verify that it is part of this module.
2. If 'mat-label' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</mat-form-field>
<mat-form-field>
[ERROR ->]<mat-label>Both a label and a placeholder</mat-label>
<input matInput placeholder="Simple"):
问题:
材料标签在 MatFormFieldModule 下面是链接
现在,Angular Material 不知道 Mat-Label 问题的可能原因是什么。
这是HTML
<mat-form-field> <mat-label>Both a label and a placeholder</mat-label> <input matInput placeholder="Simple placeholder"> </mat-form-field>
原文由 Randz67 发布,翻译遵循 CC BY-SA 4.0 许可协议
小心,如果你想在对话框中使用
@see https://material.angular.io/components/dialog/overview
好的
高
为此,您必须创建一个新组件,而不仅仅是一个 html 模板。