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

前端 未结 30 1410
予麋鹿
予麋鹿 2020-11-22 12:44

I\'ve got the following error when launching my Angular app, even if the component is not displayed.

I have to comment out the so that my

30条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 13:07

    I'm using Angular 5.

    In my case, I needed to import RactiveFormsModule too.

    app.module.ts (or anymodule.module.ts)

    import { FormsModule, ReactiveFormsModule } from '@angular/forms';
    
    @NgModule({
      imports: [
        CommonModule,
        FormsModule,
        ReactiveFormsModule
      ],
    

提交回复
热议问题