Closed visitek closed 7 years ago
<input datetime-picker
[value]="value"
(valueChange)="onValueChange($event)"
close-on-select="false"
date-format="DD.MM.YYYY HH:mm"
>
Tested and works fine with setting value and opened picker reacts immediately to external changes of input value.
Is there a reason to change ngModel
to value
. It's confusing for me. e.g. "value"="value", [value]="value"
Yes, because ngModel is encapsulated and must be implemented both with ngModelChange. In this case the visible value of input is formatted, but real value is kept in Date. It can not be used with ngModel.
We can not emit formatted value as ngModelChange event, because it is not true. Event with Date is true output
cool, one more request. could you change 8 space hard-tab to 2 space soft-tab? It makes my life a lot easier for consistency.
<input datetime-picker
[value]="fromTimeISO"
(valueChange)="onFromChange($event)"
close-on-select="false"
date-format="DD.MM.YYYY HH:mm"
>
better? :)
yes..
The reason I am asking is that using "[value]" is a breaking change. With this release, all the existing users must change their code. Thus, it must be notified to user as "BRAEKING CHANGES" for release. Can we make it [(ngModel)] deprecated if possible?
I'll try it
I've added non breaking changes. But it is really deprecated. ngModel can be used without reactive changes
create releases and handle breaking changes
is there any plnkr example??
Fixes #19 DatetimePicker is interactive now. Model value is separated from emitted value.