Closed youngzkyz closed 7 years ago
Thanks for feedback
Please take a look at this example, https://rawgit.com/ng2-ui/ng2-datetime-picker/master/app/index.html
I am not sure this is the right approach, but to make it work, you need to have formControlName="xxx"
for the input field.
<input formControlName="birthDate" ng2-datetime-picker>
https://plnkr.co/edit/W5YtoN?p=preview
This is currently how we get a AbstractControl for the input field, but I am not sure this is the right approach.
https://github.com/ng2-ui/ng2-datetime-picker/blob/master/src/ng2-datetime-picker.directive.ts#L111
I would appreciate if you suggest anything we can make use of [formControl]
, in addition to the usage of formControlName
[formControl]
and formControlName
are both correct AFAIK.
Reference:
Thanks before,
I have been test for my component if i dont using ([ngModel]). the form dont detect changes so the value still null or not changed.
here check my plunker
How to solve this?
Thanks,