Skip to content

Instantly share code, notes, and snippets.

@nightire
Created April 20, 2017 03:01
Show Gist options
  • Save nightire/b9246624dfafc245c002dd6e06c13b07 to your computer and use it in GitHub Desktop.
Save nightire/b9246624dfafc245c002dd6e06c13b07 to your computer and use it in GitHub Desktop.
Multi selection
import Ember from 'ember';
export default Ember.Controller.extend({
options: [
{id: 1, name: 'Option 1'},
{id: 2, name: 'Option 2'},
{id: 3, name: 'Option 3'},
{id: 4, name: 'Option 4'},
{id: 5, name: 'Option 5'},
{id: 6, name: 'Option 6'},
],
selected: [],
actions: {
updateSelections(options) {
this.set('selected', options)
}
}
});
{{#power-select-multiple
options=options
selected=selected
onchange=(action "updateSelections") as |option|}}
{{log option}}
{{option.name}}
{{/power-select-multiple}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-power-select": "1.7.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment