After upgrading to Angular 12, although I have all the required code in app.module.ts, all the material tags are not recognized: for example, for mat-checkbox, I have the following in app.module.ts
import { MatCheckboxModule } from '@angular/material/checkbox';
@NgModule({
imports: [
BrowserModule,
MatCheckboxModule,
and at execution:
'mat-checkbox' is not a known element:
- If 'mat-checkbox' is an Angular component,then verify that it is part of this module.
- If 'mat-checkbox' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component
And same problem for all the material tags (mat-icon, mat-table, mat-label . . .).
In previous version (Angular 9), all was OK. Thanks for help.
BaseComponent
was annotated with@Injectable()
and on angular 12 this doesn't work anymore. I changed it to@Component({template:""})
and that solved the issue. – Fistula