Last active
August 29, 2015 14:05
-
-
Save ashrafhasson/9d27b6b0bafd7e070888 to your computer and use it in GitHub Desktop.
ember-radio-button-group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// test controller | |
// To detect change in the selection, you can watch the items' `checked` | |
// property. | |
import Ember from 'ember'; | |
export default Ember.ArrayController.extend( | |
items: function () { | |
return [ | |
Ember.Object.create({value: 'any', title: 'Any', checked: true}), | |
Ember.Object.create({value: 'manual', title: 'Manual', checked: false}), | |
Ember.Object.create({value: 'automatic', title: 'Automatic', checked: false}) | |
]; | |
}.property(), | |
selected: function () { | |
return this.get('items').findBy('checked').get('title'); | |
}.property('items.@each.checked') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have a running example?