Closed mihailo-misic closed 7 years ago
Please use example given from README.md
<form [formGroup]="myForm">
<input
required
[(ngModel)]='myVar'
formControlName="date"
ngui-datetime-picker
date-only="true"/>
</form>
myForm.controls.date: {{myForm.controls.date.value}}
https://plnkr.co/edit/su2aiL?p=preview
You are missing formControlName
@allenhwkim this is what i did in the end. You do not have to have formGroup and formControlName for this template driven form to work. My example is a completely working form, there is nothing missing and everything was working, except the plugin.
Inside a template driven from (ngForm) when I choose a date using the datetime-picker the value is not set in the form object. But once i manually change something or input the date myself the form object once submitted is correct.
Plunker Example
I don't think this should be the expected behaviour. Am I doing something wrong? This seems quite simple and intuitive.
Thank you for your time.