Reputation: 3893
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.offenseDate ? charge.offenseDate | date : 'No date'}}
EXCEPTION: Error: Uncaught (in promise): Template parse errors:
Parser Error: Conditional expression {{charge.offenseDate ? charge.offenseDate | date : 'No Date' }} requires all 3 expressions at the end of the expression
Is what I'm expecting possible, or just a...pipe dream :)
Upvotes: 46
Views: 28002
Reputation: 11
For more than one pipe u can use
text="{{ item.COURSE_REGED == 0 ? ('EDU_COURSE_SIGNUP'| translate ) +(item.COURSE_COST | number)+ ('PUP_CURRENCY_NAME' | translate) : ('EDU_COURSE_SIGNED_UP'| translate) }}"
Upvotes: 1
Reputation: 657248
Just wrap it with ()
{{charge.offenseDate ? (charge.offenseDate | date) : 'No date'}}
Upvotes: 110