Skip to content

Instantly share code, notes, and snippets.

@grapho
Last active October 19, 2016 18:30
Show Gist options
  • Save grapho/a92656752e680b8dcd01f3ce2df4d106 to your computer and use it in GitHub Desktop.
Save grapho/a92656752e680b8dcd01f3ce2df4d106 to your computer and use it in GitHub Desktop.
x-select
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
this.fooArray = [];
},
actions: {
something(v) {
console.log(v);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#x-select value=fooArray on-change=(action "something") multiple=true oneWay=true as |xs|}}
{{#xs.option value=1}}
Foo
{{/xs.option}}
{{#xs.option value=2}}
Bar
{{/xs.option}}
{{#xs.option value=3}}
Baz
{{/xs.option}}
{{/x-select}}
<br>
<br>
{
"version": "0.10.6",
"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.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {
"emberx-select": "2.2.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment