首页 > 解决方案 > 在 ionic v3 中应用过滤器之前验证我是否收到日期

问题描述

我正在使用离子 v3。
具体来说:Ionic@3.20.1

我有以下代码片段

<button 
  ion-item
  *ngFor="let case of cases"
  (click)="show($event, case)">
  <h3>
    {{case.date | date: 'H:mm'}}
  </h3>
</button>

我想验证的值是日期case.date类型以避免 InvalidPipeArgument。

有什么想法可以使用ngIf? 我想避免使用方法。

谢谢

标签: javascriptangulartypescriptionic3

解决方案


推荐阅读