Search code examples
angularangular2-template

Angular2 how to handle value of date pipe is null


I have template using date pipe like this

{{value | date: 'dd/MM/yyyy'}}

this value is null

How to handle this if my value null i got string 'object not match'?


Solution

  • {{ (value !== null) ? (value | date: 'dd/MM/yyyy') : "" }}