'mat-icon' is not a known element: 1

‘mat-icon’ is not a known element:

//In the app.module.ts
...
imports: [
    ...
    MatIconModule,
],

Here is what the above code is Doing:
1. Importing the MatIconModule from the @angular/material package.
2. Adding the MatIconModule to the imports array of the AppModule.

Now, you can use the mat-icon component in your templates.

face

Similar Posts