Looking for a way to display validation messages for minimum and maximum date errors in Angular Material Datepicker
<input [min]="minDate" [max]="maxDate" matInput [matDatepicker]="picker" [formControlName]="date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<mat-error class="error-message" *ngIf="formgroup.get('date').hasError('required') && (formgroup.get('date').dirty || formgroup.get('date').touched)">Date is Required</mat-error>
The current code handles the Required validation.
I would like to implement a message that says Date should be higher than 01/01/2019 if the user enters a date earlier than minDate.
Although previous dates are disabled when minDate is set, this application allows users to input dates manually. Therefore, I need to show an error message when a date earlier than the minDate is entered.
Is there a way to achieve this?