“Can't bind to 'ngModel' since it isn't a known property of 'p-calendar'” error message trying to use PrimeNG component, why?

后端 未结 2 1525
失恋的感觉
失恋的感觉 2021-02-20 12:44

I am very new in Angular 2\\4 and I am trying to follow this quick video tutorial to add PrimeNG components to my Angular project:

http

相关标签:
2条回答
  • 2021-02-20 13:29

    Add FormsModule in your AppModule:

    // ...
    import { FormsModule } from '@angular/forms';
    // ...
    
    @NgModule({
      // ...
      imports: [
        BrowserModule,
        FormsModule,
        CalendarModule
      ],
      // ...
    })
    export class AppModule { }
    
    0 讨论(0)
  • 2021-02-20 13:32

    This will not solve your problem, but I had the same error when I try to use formControlName attribute :

    <p-calendar [(ngModel)]="value" formControlName="debutaffichage"></p-calendar>
    
    0 讨论(0)
提交回复
热议问题