After selecting date time from owl date time picker event is not firing.
<label style='margin-right:5px ;margin-left:210px'>
Date Time:
<input [owlDateTimeTrigger]="dt" [owlDateTime]="dt" class="form-control" placeholder="Date time Picker" (change)="getScheduledTime($event)">
<owl-date-time #dt ></owl-date-time>
</label>
After selecting date time from owl date time picker event is not firing.
<label style='margin-right:5px ;margin-left:210px'>
Date Time:
<input [owlDateTimeTrigger]="dt" [owlDateTime]="dt" class="form-control" placeholder="Date time Picker" (change)="getScheduledTime($event)">
<owl-date-time #dt ></owl-date-time>
</label>
Share
Improve this question
asked Oct 9, 2018 at 11:23
kanchan belekanchan bele
531 gold badge2 silver badges9 bronze badges
2
- I think ngModelChange will work – Asanka Commented Oct 9, 2018 at 11:51
- I have added one working solution please check and let me know if any error. – Karnan Muthukumar Commented Oct 9, 2018 at 12:27
2 Answers
Reset to default 10Let Try this once, It's working fine tested, Html File,
<input placeholder="Date Time:"
[(ngModel)]="dateTime"
[owlDateTimeTrigger]="dt" [owlDateTime]="dt"
(ngModelChange)="onChange($event)" <!--here added -->
>
Typescript,
onChange(data) {
alert("Triggered" + data);
console.log("Triggered", data);
}
Screenshot,
I hope its solve your problem.
Thanks,
Muthukumar
you can use ngModelChange for this
(ngModelChange)="getScheduledTime($event)"