Tuesday, June 6, 2017

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

This error may occur at your end during the Angular2 development, specially during creation of two way binding using [(ngModel)] with your Input type.

To fix this error kindly use the following in app.module.js and import the namespace like given below:

import { FormsModule } from '@angular/forms';

@NgModule({

declarations: [

AppComponent,

FirstComponent

],

imports: [

BrowserModule,FormsModule

],

providers: [],

bootstrap: [AppComponent]

})

As soon as you add this into the above given file.it should start work as anticipated.

0 comments :

Post a Comment