'mat-select' is not a known element
See original GitHub issueBug, feature request, or proposal:
bug
What is the expected behavior?
No error
What is the current behavior?
I upgraded from angular 4 to 6 After that when running project I get error:
'mat-select' is not a known element:
1. If 'mat-select' is an Angular component, then verify that it is part of this module.
2. If 'mat-select' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("-form-field>
<mat-form-field>
[ERROR ->]<mat-select formControlName="provinceFormControl" placeholder="Provincia" name="country_shipping"
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 6.0.7 Node: 8.11.2 OS: win32 x64 Angular: 6.0.3 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, platform-server, router
Package Version
@angular-devkit/architect 0.6.7 @angular-devkit/build-angular 0.6.7 @angular-devkit/build-optimizer 0.6.7 @angular-devkit/core 0.6.7 @angular-devkit/schematics 0.6.7 @angular/cdk 6.2.0 @angular/cli 6.0.7 @angular/material 6.2.0 @ngtools/webpack 6.0.7 @schematics/angular 0.6.7 @schematics/update 0.6.7 rxjs 6.2.0 typescript 2.7.2 webpack 4.10.2
Is there anything else we should know?
I moved every
<mat-select>
inside a
<mat-form-field>
and addedd import for MatFormFieldModule in app.module
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
You also have to import the
MatSelectModule
.@ORESoftware In app.module.ts file - @NgModule({ declarations: [ AppComponent ], imports: [ MatSelectModule ]