我正在开发一个简单的角度应用程序,并在通常情况下导入材料表单字段时得到:
src/app/auth/login/login.component.html:8:5 - error NG8001: '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-label>Password</mat-label>
和我的模块:
@NgModule({
declarations: [RegisterComponent, LoginComponent],
imports: [
CommonModule,
BrowserModule,
BrowserAnimationsModule,
ReactiveFormsModule,
HttpClientModule,
FormsModule,
MatFormFieldModule,
MatInputModule,
MatButtonModule,
MatTabsModule,
],
providers: [],
exports: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
我正在使用angular 9.1.9,有什么想法吗? 干杯
答案 0 :(得分:0)
找到它了,它没有将此模块导入app.module
中。