I'm trying to use form validation on a Kendo UI for Angular DatePicker and it just doesn't seem to work.
I'm doing the following on all other form elements:
<div class="form-group row" [ngClass]="{ 'has-danger' : email.invalid && (email.dirty || email.touched) }">
<input id="email" type="text" class="form-control" [(ngModel)]="member.email" name="email" #email="ngModel" required />
</div>
This works perfectly fine.
But when I try the same with the Kendo UI for Angular DatePicker I get the following error:
<div class="form-group row" [ngClass]="{ 'has-danger' : geburtsdatum.invalid && (geburtsdatum.dirty || geburtsdatum.touched) }">
<kendo-datepicker
id="geburtsdatum"
[format]="'dd.MM.yyyy'"
[(value)]="mitglied.geburtsdatum"
#geburtsdatum="ngModel"
required>
</kendo-datepicker>
</div>
Now I get the error:
There is no directive with "exportAs" set to "ngModel".
I can't seem to find a way to validate Kendo UI for Angular form elements in a simple way.
[(ngModel)]for thekendo-datepickerinstead of[(value)]? 'Cause that's how we are using it and it works just fine.