Using date pipe in a conditional expression - Angular 2

前端 未结 1 447
有刺的猬
有刺的猬 2020-12-29 02:11

With the follow expression I\'m expecting for Angular to interpolate a date (if not null) through the date pipe, but I get the proceeding error.

{{charge.off         


        
1条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 02:53

    Just wrap it with ()

    {{charge.offenseDate ? (charge.offenseDate | date) : 'No date'}}
    

    0 讨论(0)
提交回复
热议问题