天道酬勤,学无止境

angular-material-datetimepicker

Set default value for angular material datePicker with angular 5

I'm using a date picker from angular material. I want to set a default value but it is not showing the value. <mat-form-field class="mr-sm-24" fxFlex (click)="open()" > <input matInput [picker]="picker" placeholder="Date" autocomplete="off" name="date" formControlName="date"> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker [startAt]="startDatePicker" #picker></mat-datepicker> </mat-form-field> this is my .js code with the value that i want to set as default var date = this.datepipe.transform((new Date().getTime()) - 3888000000, 'dd/MM/yyyy'); this.form

2021-04-19 13:37:29    分类:问答    angular   typescript   angular-material   angular-material-datetimepicker