Link to Material Design datepicker official page
I recently learned how to use the Material Design datepicker from the official website and now I want to bind the selected data to a Date object.
Here is an example code snippet from datepicker-overview-example.component.html:
<md-input-container>
<input mdInput [mdDatepicker]="picker" placeholder="Choose a date">
<button mdSuffix [mdDatepickerToggle]="picker"></button>
</md-input-container>
<md-datepicker #picker></md-datepicker>
In the component file datepicker-overview-example.component.ts:
import {Component} from '@angular/core';
@Component({
selector: 'datepicker-overview-example',
templateUrl: 'datepicker-overview-example.component.html',
styleUrls: ['datepicker-overview-example.component.css'],
})
export class DatepickerOverviewExample {
@Input() date: Date;
}
I'm looking for guidance on how to properly bind it. Any suggestions?