import Ember from 'ember';

export default 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'));
    },

    _updateElementValue: function() {
        Ember.run.next(this, function() {
          this.$().prop('checked', this.get('htmlChecked'));
        });
    }.observes('htmlChecked')
});

import Ember from 'ember';

export default Ember.View.extend({
    tagName: 'input',
    type: 'radio',
    attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name', 'disabled'],

    htmlChecked: function() {
        return this.get('value') === this.get('checked');
    }.property('value', 'checked'),

    change: function() {
        this.set('checked', this.get('value'));
    },

    _updateElementValue: function() {
        Ember.run.next(this, function() {
          this.$().prop('checked', this.get('htmlChecked'));
        });
    }.observes('htmlChecked')
});

Add support for the `disabled` attribute on radio inputs.
Add support for the `disabled` attribute on radio inputs.
