Created
June 3, 2014 18:04
-
-
Save courajs/7973c9bec27f0e0a3508 to your computer and use it in GitHub Desktop.
Simpler explicit name radio buttons
This file contains hidden or 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
var RadioView = Ember.View.extend({ | |
tagName: 'input', | |
type: 'radio', | |
attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name'], | |
htmlChecked: function(){ | |
return this.get('value') === this.get('checked'); | |
}.property('value', 'checked'), | |
change: function(){ | |
this.set('checked', this.get('value')); | |
} | |
}); | |
export default RadioView; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried this and it works but for some reason my observers only fire once. I set the value and observer like this.
Can you reproduce this?