'Can't bind to 'ngModel' since it isn't a known property of 'ion-select'
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
Solution 1:[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
Solution 2:[2]
You need to add this to components modules
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
IonicModule,
FormsModule
];
})
Solution 3:[3]
import { FormsModule } from '@angular/forms';
Simply, import the above (FormsModule) module in your modules page it will work!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Aouizerats Oury |
| Solution 2 | SimplifyJS |
| Solution 3 | Syscall |
