angular – Cant bind to ngModel since it isnt a known property of input error

angular – Cant bind to ngModel since it isnt a known property of input error

  1. You dont want to import modules in your component.

So remove this from the component:

import {FormsModule} from @angular/forms;
  1. Make sure CustomerModule is imported in your AppModule.

Let me know if that helps.

Perhaps a tad late, but hopefully will help others.

First, you should import FormsModule on app.module.ts –import { FormsModule } from @angular/forms

Second, use FormsModule like so:

@NgModule({
  declarations: [
    AppComponent
   
  ],
  imports: [
    BrowserModule,
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})

angular – Cant bind to ngModel since it isnt a known property of input error

Leave a Reply

Your email address will not be published.