after upgrading to angular 12, all material components are "not a known element"

Discussão em 'Angular' iniciado por bruno, Janeiro 27, 2025.

  1. bruno

    bruno Guest

    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:

    1. If 'mat-checkbox' is an Angular component,then verify that it is part of this module.
    2. 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.

    Continue reading...

Compartilhe esta Página