This dropdown supports single selections as well as multiple sections. See example usage below.
ember install ember-cli-dropdown-list
single item selection example
{{dropdown-list
content=myDataList
value=myAwesomeValue
class="chosen-select"
action="myChangeAction"
prompt="Choose your poison"
optionValuePath="content.value"
optionLabelPath="content.label"
}}
multiple item selection example
{{dropdown-list
content=myDataList
value=myAwesomeValues
class="chosen-select"
action="myChangeAction"
prompt="Choose your poisons"
optionValuePath="content.value"
optionLabelPath="content.label"
}}
content: Array<object>
optionValuePath: string denoting the path to an item in the content array to use when updating the value property (see below for information on value)
optionLabelPath: string denoting the path to an item in the content array to use as a nice string to render in the list item
value: object that should be updated with the selected value in the dropdown list. The actual value set is dependent on the optionValuePath
multiple: boolean value denoting whether multiple items in the list can be selected. Default is false.
class: string that should be used as class name for the select element
prompt: optional string to display on the top of the dropdown list when nothing is selected
action: name of function to invoke when the selected option changes
git clone <repository-url>
cd ember-cli-dropdown-list
yarn install
yarn lint:js
yarn lint:js --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.