mat-icon is not a known element in angular even when I'm using the right method

751 Views Asked by At

I'm trying to use mat-icon but it shows me error :'mat-icon' is not a known element:

  1. If 'mat-icon' is an Angular component, then verify that it is part of this module.
  2. If 'mat-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.ngtsc(-998001)

I import it in my app.module.ts

import { MatIconModule } from '@angular/material/icon'

  imports: [
    BrowserModule,
    AppRoutingModule, ReactiveFormsModule,
    FormsModule, HttpClientModule,
    MatIconModule
  ]

and in the index.html I added :

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

any help please

0

There are 0 best solutions below