dimanche 27 septembre 2015

Ember bind attribute using truth helper

I'm using Ember v1.13 and would like to render the checked attribute of an input element based on the result of an ember-truth-helpers expression. The following DID NOT work for me:

<input type="radio" checked={{(eq arg1 arg2)}}>

<input type="radio" checked={{if (eq arg1 arg2) true false}}>

Is there a way to do this, or do I have to resort to the following (which works)?

  {{#if (eq arg1 arg2)}}
      <input type="radio" checked>
  {{else}}
      <input type="radio">
  {{/if}}




Aucun commentaire:

Enregistrer un commentaire