debugtypescriptangularCritical
Angular error: "Can't bind to 'ngModel' since it isn't a known property of 'input'"
Viewed 0 times
angularerrorbindknownpropertyisninputngmodelsincecan
Problem
I'm using Angular 4 and I am getting an error in the console:
Can't bind to 'ngModel' since it isn't a known property of 'input'
How can I resolve this?
Can't bind to 'ngModel' since it isn't a known property of 'input'
How can I resolve this?
Solution
In order to use two-way data binding for form inputs you need to import the
EDIT
Since there are lot of duplicate questions with the same problem, I am enhancing this answer.
There are two possible reasons
-
Missing
-
Check the syntax/spelling of
FormsModule package in your Angular module.import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule
]EDIT
Since there are lot of duplicate questions with the same problem, I am enhancing this answer.
There are two possible reasons
-
Missing
FormsModule, hence Add this to your Module,import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule
]-
Check the syntax/spelling of
[(ngModel)] in the input tagCode Snippets
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule
]import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
FormsModule
]Context
Stack Overflow Q#43298011, score: 952
Revisions (0)
No revisions yet.