Angular project occurs error :"Can't bind to ngModel since it isn't a known property of 'input'"

Forums AngularAngular project occurs error :"Can't bind to ngModel since it isn't a known property of 'input'"
Staff asked 1 month ago

I am getting this error in the console How can I solve this?

Answers (1)

Add Answer
Staff answered 1 month ago

This error occurs when you use input element without importing appropriate module in app.module.ts file.

Angular provide us two way binding with input element or others.

You have to import FormsModule to implement two way binding in input element.

Import Module as following in app.module.ts file

import { FormsModule } from ‘@angular/forms’;

@NgModule({
imports: [
FormsModule
]

Subscribe

Select Categories