ember-radio-button
Note: ember-radio-button 1.0.0 requires using htmlbars. For applications not using htmlbars, use version 0.1.3 or the pre-htmlbars
branch
This ember-cli addon provides a radio-button
component.
Pass two properties to the component: value
and groupValue
. A radio-button
will be in a checked state when groupValue === value
.
Clicking on a radio-button
will set groupValue
to its value
.
The component exposes a changed
action that allows you to do something
when a user interaction causes one of your radio buttons to update groupValue
.
Template:
{{radio-button
value="green"
groupValue=color
changed="colorChanged"}}
{{#radio-button
value="blue"
groupValue=color
changed="colorChanged"}}
Blue
{{/radio-button}}
Results in:
<input id="ember345" class="ember-view" type="radio" value="green">
<label id="ember346" class="ember-view">
<input id="ember347" class="ember-view" type="radio" value="blue">
Blue
</label>
See the dummy app and tests for more example usage
Installing
npm install ember-radio-button --save-dev
Collaborating on this repo
git clone
this repositorynpm install
bower install
Running
Running Tests
ember test
ember test --server
Building
For more information on using ember-cli, visit http://www.ember-cli.com/.