angularangular-material

Material designing issue in Angular apps


I am beginner with Angular and I want to use material Basic Inputs fields in my application. I followed this blog to do my requirement https://material.angular.io/components/input/overview but when I run my code I am getting this error:

Template parse errors:
'mat-form-field' is not a known element:
1. If 'mat-form-field' is an Angular component, then verify that it is part of this module.
2. If 'mat-form-field' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the

Below I give my Stackblitz link. Where have I gone wrong?

https://stackblitz.com/edit/angular-ux8kqk


Solution

  • You have not imported MatInputModule in your .module.ts

    Make following changes in your app.module.ts

    import {MatInputModule} from '@angular/material/input';

    imports : [
     // Other modules
     MatInputModule
    ]