Set default date for datepicker in angular 2 material

if you are using reactive forms, below is working angular 10 code:



        StartDate: [new Date(), Validators.required],


No change on component.html

  <mat-form-field appearance="outline">
            <input matInput [matDatepicker]="StartDate" placeholder="Start date *" 
            <mat-label>Start Date *</mat-label>
            <mat-datepicker-toggle matSuffix [for]="StartDate"></mat-datepicker-toggle>
            <mat-datepicker #StartDate></mat-datepicker>

You need to initialize your date model. In your ts code, do the following in constructor or in the method where you get planModel:

planModel.start_time = new Date(); // Current Date

Link to working demo.