我正在尝试在Date
字段中显示input
对象并仅显示分钟
<mat-form-field>
<input matInput type="time" placeholder="Choose a time"
[(ngModel)]="appointmentTime"
[ngModel]="appointmentTime | date:'HH:mm'"/>
</mat-form-field>
但是,时间没有正确显示 - 实际上根本没有显示:
在课堂上,appointmentTime
和appointmentDate
被初始化为
public appointmentDate = new Date();
public appointmentTime = new Date();
答案 0 :(得分:-1)
<input matInput type="time" placeholder="Choose a time"
[ngModel]="appointmentTime | date:'HH:mm'"/>