Skip to content

Instantly share code, notes, and snippets.

@TLiu2014
Last active November 23, 2018 19:51
Show Gist options
  • Save TLiu2014/4d285dd4edc7676531252e5d5bf476bc to your computer and use it in GitHub Desktop.
Save TLiu2014/4d285dd4edc7676531252e5d5bf476bc to your computer and use it in GitHub Desktop.
<form #datePickerForm>
<mat-form-field>
<input matInput [min]="minDate" [matDatepicker]="picker" placeholder="Choose a date" #pickerInput [formControl]="date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
<mat-error *ngIf="date.invalid">{{getErrorMessage(pickerInput.value)}}</mat-error>
</mat-form-field>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment