Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created January 2, 2020 11:38
Show Gist options
  • Save lydemann/3fa69740bf2df95bfe0f03d87cc362eb to your computer and use it in GitHub Desktop.
Save lydemann/3fa69740bf2df95bfe0f03d87cc362eb to your computer and use it in GitHub Desktop.
date-picker.component.html
<mat-form-field>
<input
matInput
[matDatepicker]="picker"
[disabled]="isDisabled"
[value]="date"
[min]="minDate"
[max]="maxDate"
(dateChange)="onDateChange($event)"
[formControl]="formControl"
[errorStateMatcher]="dateErrorStateMatcher"
[placeholder]="placeholder"
/>
<mat-error>{{ errorMessage }}</mat-error>
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment