【发布时间】:2018-12-29 14:08:12
【问题描述】:
我正在使用角度材料 6,当在 mat-form-field 之后移动到正确显示的 mat-error 时,mat-form-field mat-error is not displayed 内部有一个变化。
不工作的代码:
<mat-form-field>
<input matInput type="time" formControlName="ToTime"/> <mat-error *ngIf="DaterForm.get('ToTime').hasError('InValidToTime')">FromTime Should be less than ToTime if choose a same date</mat-error>
</mat-form-field>
工作正常:
<input matInput type="time" formControlName="ToTime"/> </mat-form-field>
<mat-error *ngIf="DaterForm.get('ToTime').hasError('InValidToTime')">FromTime Should be less than ToTime if choose a same date</mat-error>
有人解释了为什么在该控件中不起作用。
现场演示: stackblitz
【问题讨论】:
标签: angular angular-material2 angular6 angular-material-6