I have a property that I am displaying on an angular template which may or may not be a date. If it is a date, I would like to format it but if it's not, I just want to show the value.
This is what I have tried based on researching and it only worked for dates, for everything else it was blank:
<td>{{key | date: 'MM/dd/yyyy' || key}}</td>
I could add a Boolean property:
<td *ngIf="isDate">{{key | date: 'MM/dd/yyyy'}}</td>
<td *ngIf="!isDate">{{key}}</td>
but is there a way to do this directly in the template?