Can't bind to 'ngModel' since it isn't a known property of 'ion-select'

我只是一个虾纸丫 提交于 2019-12-23 02:49:49

问题


Hello everyone when i'm compile my app in prod release i got an error

Can't bind to 'ngModel' since it isn't a known property of 'ion-select'.

My code

<ion-select #sel1  [(ngModel)]="Selectedcat" (ngModelChange)="onChange()" >

i make this configuration in appmodule :

imports: [
 BrowserModule,
 HttpModule,
 Ionic2RatingModule ,
 FormsModule,
 IonicModule.forRoot(MyApp),
 IonicStorageModule.forRoot(),
 IonicImageLoader.forRoot()
 ]

thanks for yours help


回答1:


I solved my problem

the problem was because I use in a component so you need to add in components.modules.ts imports: [IonicModule],

that's all



来源:https://stackoverflow.com/questions/48674657/cant-bind-to-ngmodel-since-it-isnt-a-known-property-of-ion-select

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