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

心已入冬 提交于 2019-12-04 02:48:42

Add FormsModule in your AppModule:

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

@NgModule({
  // ...
  imports: [
    BrowserModule,
    FormsModule,
    CalendarModule
  ],
  // ...
})
export class AppModule { }

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!