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
- If 'mat-error' is an Angular component, then verify that it is part of this module.
- If 'mat-error' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
I have already imported FormsModule and it wasn't giving error before but I don't why it suddenly started giving this error.
Also include into imports array
Error showing. I have already inserted the angular material as well as all the necessary imports
Also included FormsModule in app.component.spec.ts
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"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.