-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
(I know this component was made for Ionic 4, though I encountered following problem with Ionic 5 and Angular 9; I don't know whether this still works with Ionic 4)
When using the directive to add the date picker to an ion-input
, the input field doesn't update its value to the picked date.
It took me a while to find out why, it seems like the providers: [NgModel]
option in the @Directive()
decorator is the issue. When removing this line, the date picker works as expected. See: https://github.com/logisticinfotech/ionic4-datepicker/blob/master/projects/ionic4-datepicker/src/lib/li-ionic4-datepicker.directive.ts#L12
@Directive({
selector: '[customIonicDatepicker]',
exportAs: 'customIonicDatepicker',
providers: [NgModel], // remove this line
})
Metadata
Metadata
Assignees
Labels
No labels