Fast response @ selva-G.
I found that using the ButtonGroup component from Bootstrap-for-Ember is actually cleaner. Here is what I did:
In my view template:
<script type="text/x-handlebars" data-template-name="myview"> {{bs-btn-group contentBinding="things" selectedBinding="selectedThing"}} </script>
In this view, the controller (which does not have to be an ArrayController, could rather be a common Ember Controller):
App.MyviewController = Ember.ArrayController.extend({ things: [ Ember.Object.create({value: 'first', title: 'First Thing'}), Ember.Object.create({value: 'second', title: 'Second Thing'}), Ember.Object.create({value: 'third', title: 'Third Thing'}) ], selectedThing: 'second' selection: function() { console.log(this.get('selectedThing'); }.observes('selectedThing') });
source share