Closed WilliamDASILVA closed 7 years ago
Hi William, thanks for your code!
Unfortunately change
event is already implemented using standard ng-change
and I can't see any potential in supporting cancel
event. I would consider it when there is more demand for it and also consider adding it for the next major version.
If you really want to use it, you can add WilliamDASILVA/ion-datetime-picker#feature/events
to your bower.json
file to pull your branch.
Thanks anyway, good job!
I see that you are using "=?"
attribute signature for events. You should be using "&"
instead, but that would require a little code change in the picker. Just an idea :)
Hello there,
I needed to detect whenever the user clicks on 'OK' or 'Cancel'. Using $watch on the model wasn't ok for me for multiple reasons. So I added two more attributes 'on-change=' and 'on-cancel='.
<span ng-model="myDate" ion-datetime-picker on-change="myFunction" on-cancel="cancelFunction">
In controller: