-1

My project was completely running fine but I don't how, when, Where What happened that it's giving error

Can't bind to 'ngModel' since it isn't a known property of 'input'

and also

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

enter image description here I have already imported FormsModule and it wasn't giving error before but I don't why it suddenly started giving this error.

enter image description here Also include into imports array

enter image description here Error showing. I have already inserted the angular material as well as all the necessary imports

enter image description here Also included FormsModule in app.component.spec.ts

Joundill
  • 6,828
  • 12
  • 36
  • 50
  • 2
    Please post your code here as text and not an image. – Phix Jun 02 '20 at 22:39
  • 1
    Welcome to Stack Overflow! Your code is in images, which means it can't be searched by people who have the same question as you in the future. Please have a read of [this guide on producing code for a good quality question](https://stackoverflow.com/help/minimal-reproducible-example), then include and mark up your code in your question. Cheers! – Joundill Jun 03 '20 at 00:26

1 Answers1

0

Looks like you have lazy loaded modules, for them you need to import FormsModule in the related module, not in the app.module. try to import them in EventRegiterModule.

If it's Angular 2+ you should use [ngModel]="Email_id" (ngModelChange)="Email_id = $event" instead of [(ngModel)]="Email_id"

satanTime
  • 12,631
  • 1
  • 25
  • 73