I have the following template:
<input type="text" class="form-control" name="my_date"
[matDatepicker]="myDatepicker" #myDate="ngModel"
[(ngModel)]="myDateValue" id="my_date" required>
<mat-datepicker-toggle [for]="myDatepicker"></mat-datepicker-toggle>
<mat-datepicker #myDatepicker></mat-datepicker>
<div *ngIf="myDate.errors && (myDate.touched || cFormDirective.submitted)">
<div *ngIf="myDate?.errors?.required">
Please enter date
</div>
</div>
When clicking submit the style for the input textbox applied correctly in red correctly but the message not shown.
As you can see this a template driven form and I don't wish to update it now to reactive form just because of the date, also I don't use mat form field cause a different design when doing so.
Any idea how can I show the message ?