Using date pipe in a conditional expression - Angular 2

前端 未结 1 440
有刺的猬
有刺的猬 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)
提交回复
热议问题