Angular2 how to handle value of date pipe is null

Youngz ie picture Youngz ie · Feb 8, 2017 · Viewed 31.9k times · Source

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'?

Answer

Bharat Chauhan picture Bharat Chauhan · Feb 8, 2017
{{ (value !== null) ? (value | date: 'dd/MM/yyyy') : "" }}