3gwebtrain
3gwebtrain

Reputation: 15293

Adding multiple `Helpers` to template file

I am trying to add multiple helper in hbs file. But getting error. Can't I add multiple helpers?

<span class="label-value">{{is-empty-value convert-to-currency card.balances.current-balance}}</span>
  1. card.balances.current-balance : number value getting
  2. convert-to-currency : converting to currency
  3. is-empty-value : adding hyphen if value is empty

I have written helpers for some other reasons; now I am trying to use all together, but it does not work. It is only considered as empty values.

Upvotes: 0

Views: 263

Answers (1)

Jacob van Lingen
Jacob van Lingen

Reputation: 9537

If you want to use a helper within a helper (called subexpressions), you need to use parentheses around the inner helper:

<span class="label-value">{{is-empty-value (convert-to-currency card.balances.current-balance)}}</span>

Upvotes: 3

Related Questions