bind-attr not working with colspan
@alexspeller Thank you, Ya it’s work for me but I want to set colspan count based on the property
like : <td {{bind-attr colspan='setColspan:2:1'}}>FOO</td>
, how can achieve this one
@jasonmit Thank you, I did this workaround but I want use with single property.
like <td {{bind-attr class="showRed:redBG:yellowBG" }}>FOO</td
here showRed is true apply redBG class otherwise apply yellowBG. Here we done with single property works, but colspan not work like this.
You cannot. Only classes work like this, not other attributes.
It does work:
<td {{bindAttr colspan="view.columnNumbers"}}
Hi, I used to have similar issues. It seems like a workaround because you’re trying to put logic into your templates, but handlebars kind of precludes you from doing this. It’s better to put the logic in the controller. Separation of concerns.
If you’re concerned about putting view logic on your controller, the above examples could just as easily go into the view.