vendredi 18 décembre 2020

How to pass conditional string to ember component attribute using concat?

What is the correct way to pass the conditional string when assigning the component's attribute using ember concat() method?

Consider the following


  

What I want to do is adding the --disabled postfix conditionally, based on model.disabled property.

What I have tried:

")}}
  

Resulting in:

<div class="component-name-row">
  Component name
</div>

The other thing I tried was using ternary helper, based on this answer:


  

but it crashed:

Assertion Failed: A helper named "ternary" could not be found

Is there any way to do that? If not, how would I achieve the same effect using a different approach?




Aucun commentaire:

Enregistrer un commentaire