ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

question: how to trigger a standard html event on this component? #104

Closed stefanaerts closed 7 years ago

stefanaerts commented 7 years ago

How can i call a method when the popup is closed/value of the inputfield is changed wiht a new selected date? So i want to update another variable with the date i get when selected. methods like onchange="myfunction(this.value)" do not seem to work. As you can see in the pciture below i want to update the label above with the new selected date on close. image

How can i do that?

allenhwkim commented 7 years ago

Currently it does fire ngModelChange event. https://github.com/ng2-ui/ng2-datetime-picker/blob/master/src/ng2-datetime-picker.directive.ts#L49

stefanaerts commented 7 years ago

Thank you @allenhwkim for your fast responses. It works nice with the (ngModelChange)="setTextValue($event)" I have almost a nice progressive/mobile webapp finished with several nice features:

And all of this for free, viva open source.

image

image

image

image