Help please set the default value in datepicker ng material 2
In my case, the datapicher itself is associated with the model as follows:
<md-input-container> <input mdInput [mdDatepicker]="picker" placeholder="Choose a date" [(ngModel)]="modelDateBegin"> <button mdSuffix [mdDatepickerToggle]="picker"></button> </md-input-container> <md-datepicker #picker></md-datepicker> The component sets the model value as follows:
export class DatepickerOverviewExample { private modelDateBegin = '02.07.2017'; } As a result, the browser shows a datapyker, in which the value is preset: "07.02.2017". This is clearly not what was installed in the component.
A live example is here: PLUNKER
PS:
Moreover, if on the same page to use the second datapiker, then in the manner described above, the value in it is not set at all