Is there a way to render component in HTMLBars as argument passed in concat helper?
I have fa-icon
ember component and my custom component that displays label. I need to display it like:
{{my-simple-button label=(concat (fa-icon "pencil") " " (t "myAwesomeTranslate"))}}
but, obviously, fa-icon
is a component not a helper.
Update.
Thanks! In fact I use ember-async-button
with custom messages, and therefore I have to write something like
{{#async-button as |component state|}}
{{#if state.isPending}}
{{if pendingLabel pendingLabel (t 'site.actions.pending')}}
{{else if state.isDefault}}
{{label}}
{{else if state.isRejected}}
{{label}}
{{else if state.isFulfilled}}
{{label}}
{{/if}}
{{/async-button}}
So I want a wrapper like my-simple-button
which takes label
and pendingLabel
and hides those ifs
. So I can't use block because I need to set up icons in 4 places. The only option I see is using ifs for icon
and pendingIcon
properties, but that makes code ugly. So basicly I want to know if there is a way to simplify this...