ember-select-tag
Version:
A basic select input for ember.
60 lines (37 loc) • 1.5 kB
Markdown
ember-select-tag is a basic `<select>` component which strives to replace the old `{{view 'select'}}` while following the modern ember paradigm of "data-down-actions-up" as closely as possible.
coming soon
* npm install ember-select-tag
A straight replacement of the old select view would be done in the following way.
The following handlebars markup
```handlebars
{{view "select"
content=programmers
optionValuePath="content.id"
optionLabelPath="content.firstName"
value=selectedProgrammerId}}
```
can be replaced with
```handlebars
{{select-tag content=programmers
optionValuePath='id'
optionLabelPath='firstName'
value=selectedProgrammerId)}}
```
The following attribute bindings are supported: `disabled`
The following syntax for label and value paths is supported and will work.
```handlebars
{{select-tag content=myData
optionValuePath='level1.level2.id'
optionLabelPath='level1.level2.label'}}
```
The corresponding component property will simply be set to the value of the entire selected item in the content array.
content can be int he format of `['Item A', 'Item B', ...]` or `[ ObjectA, ObjectB, ...]`.
This addon should currently work with ember@2.x