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

Vijay Kumar :

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?

Sajeetharan :

In order to use two-way data binding for form inputs you need to import the 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 tag

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

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

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

Angular Binding errror - Can't bind to 'ngModel' since it isn't a known property of 'input' even though the property exists

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

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

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

Angular2 Quickstart Tutorial Breaking Karma Tests - "Can't bind to 'ngModel' since it isn't a known property of 'input'."

Angular 2: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'

Angular 4 "Can't bind to 'ngModel' since it isn't a known property of 'input'."

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

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

Getting error with ngIf in Angular

ERROR Error: StaticInjectorError Angular 6

Angular error creating an angular app

Angular HttpClient error handling

Error $ is not defined in Angular Universal

splitSeries error with packedbubble in Angular

no module error in angular with requirejs

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

Angular CLI Error

Angular 2 tsc error

Angular $http 404 error

Error building Angular CLI

Can't bind to 'ngModel' since it isn't a known property of 'input' angular 5 with pug

Can't bind to '(ngModel' since it isn't a known property of 'input' in angular unit test case

Can't bind to 'ngModel' since it isn't a known property of 'input'. ("="col-md-4 control-label" for="idNome">Nome: </label>

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

Angular9-MatDatePicker: Can't bind to 'ngModel' since it isn't a known property of 'input'

Can't bind to 'ngModel' since it isn't a known property of 'input'.ngtsc(-998002)