如何使用力矩验证查找无效的日期或时间

我有一个时间字段,当由于此管道| HH:mm而导致用户键入值时,仅键入时我在控制台中收到无效的日期错误。如何处理ts文件中的无效日期。

HTML

  <input type="text" (ngModelChange)="onChangeStartTime($event)"
   id="starttime" placeholder="hh:mm"[ngModel]="startTime | date: 'HH:mm'" maxlength="5" appInputRestriction="time"/>

TS

 onChangeStartTime(date: Time) {
    this.startTime = date;
  }
harry898 回答:如何使用力矩验证查找无效的日期或时间

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3160924.html

大家都在问