https://github.com/cottrellio/ember-dc-select
A simple ember select component
https://github.com/cottrellio/ember-dc-select
Last synced: 12 months ago
JSON representation
A simple ember select component
- Host: GitHub
- URL: https://github.com/cottrellio/ember-dc-select
- Owner: cottrellio
- License: mit
- Created: 2016-04-03T15:59:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-05T14:34:40.000Z (about 10 years ago)
- Last Synced: 2025-03-13T06:13:51.505Z (about 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-dc-select
A simple select component for Ember.
## Example Use
_controller.js_
```
selectedOption: {
label: 'Test 2',
value: 2
},
options: Ember.A([
{
label: 'Test 1',
value: 1,
disabled: false
},
{
label: 'Test 2',
value: 2,
disabled: false
},
{
label: 'Test 3',
value: 3,
disabled: true
},
{
label: 'Test 4',
value: 4,
disabled: false
},
{
label: 'Test 5',
value: 5,
disabled: false
}
]),
actions: {
selectionDidChange(value) {
let selected = this.get('options').findBy('value', +value);
this.set('selectedOption', selected);
}
}
```
_template.hbs_
```
{{dc-select onChange=(action "selectionDidChange")
selectedOption=(readonly selectedOption)
options=(readonly options)}}
```