ember.js - EmberJS: Using helpers in component properties -
i'm trying sweeten component template:
{{#link-to 'invoice' model.next.id }} {{format-number model.next.amount format="usd"}} due {{format-relative model.next.due units="day"}} {{/link-to}}
as can see, verbosity makes hard see final link text. following easier parse:
{{#link-to 'invoice' model.next.id }} {{amount}} due {{date}} {{/link-to}}
to enable syntax i'm thinking computed properties help, i'm unsure how leverage format-number
, format-relative
helpers within component definition.
so, how add sugar component {{format-number model.next.amount format="usd"}}
becomes {{amount}}
? on right track?
Comments
Post a Comment