angular – primeng checkbox ngmodel不是已知属性

前端之家收集整理的这篇文章主要介绍了angular – primeng checkbox ngmodel不是已知属性前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用p-checkBox pf prime ng 4.1 rc2版本

我收到以下错误

Can't bind to 'ngModel' since it isn't a known property of 'p-checkBox'.

我在app.module.ts中添加了通用模块,表单模块,但它仍然无法正常工作

解决方法

ngModel is part of FormsModule,that is why you will need to import FormsModule from @angular/forms and add it inside imports Metadata option of NgModule. After doing this,you should be able to use ngModel directive in the templates that belong to the module where FormsModule was imported.

mymodule.module.ts

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

@NgModule({
    imports: [CommonModule,FormsModule,...

猜你在找的Angularjs相关文章