I am just curious why in my example bindAttr is not working with arrays. Is it going to be implemented in future or made on purpose or I am missing something?
Handlebars
<script type="text/x-handlebars">
<h1>Using bindAttr with objects</h1>
{{#each App.residents}}
<div {{bindAttr class="isIrish:irish"}}>{{name}}</div>
{{/each}}
</script>
<script type="text/x-handlebars">
<h1>Using bindAttr with arrays</h1>
{{#each App.residents2}}
<div {{bindAttr class="[1]:irish"}}>{{[0]}}</div>
{{/each}}
</script>
javascript
App = Ember.Application.create({
residents: [
{name: "St. Patrick", isIrish: true},
{name: "Leprechaun", isIrish: true},
{name: "Saulius", isIrish: false},
],
residents2: [
["St. Patrick",true],
["Leprechaun",true],
["Saulius",false],
]
});
I found a way to make this work: