I would like to use angular material Datepicker to select dates. Once the date is picked I would like to update a value. The below code works (i.e. value gets updated) if I type something the input field of the Datepicker, but not when picking the date through the Datepicker toggle.
My best guess is that I should use something other than (input)="updateDate($event)"
in the html.
app.component.html:
<mat-form-field>
<mat-label>Choose start date</mat-label>
<input matInput [matDatepicker]="picker" (input)="updateDate($event)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
app.component.ts:
updateDate(event: any) {
this.exam.date = event.target.value;
}