Hmm, at first I thought that using attributeBindings allowed according to this post and this post , but when I try to do this, I get this error:
Uncaught Error: assertion failed: Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.
So, I think the best method now is to do it in a class.
Control Panel Template:
<script type="text/x-handlebars"> {{#each book in view.bookcase}} {{view App.BookView classBinding="book.read:read:unread" contentBinding="book"}} {{/each}} </script>
Extended class:
App.BookView = Ember.View.extend({ attributeBindings: ['book-id'], 'book-id': function() { return this.content.id; }.property('content.id') });
Example: jsFiddle snippet
source share