I had this issue. I imported MatFormFieldModule at my main module, but forgot to add MatInputModule to the imports array, like so:
import { MatFormFieldModule, MatInputModule } from ‘@angular/material’;
@NgModule({
imports: [
MatFormFieldModule,
MatInputModule
]
})
export class AppModule { }
More info here.
Problem 1: MatInputModule Not imported
import MatInputModule and MatFormFieldModule inside module i.e. app.module.ts
import { MatInputModule } from ‘@angular/material/input’;
import { MatFormFieldModule } from “@angular/material/form-field”;
@NgModule({
imports: [
MatFormFieldModule,
MatInputModule
]
})
export class AppModule { }
Problem 2: Spellings Mistake
Be sure to add matInput and it is case-sensitive.
Problem 3: Still compiler giving ERROR
if angular compiler still giving error after fixing above given problems then you must try with restarting the app.
ng serve