Skip to content

Instantly share code, notes, and snippets.

@ahmetemrekilinc
Created November 11, 2017 18:07
Show Gist options
  • Save ahmetemrekilinc/adf3db76e8aca71e43f6b5aa3303b6c3 to your computer and use it in GitHub Desktop.
Save ahmetemrekilinc/adf3db76e8aca71e43f6b5aa3303b6c3 to your computer and use it in GitHub Desktop.
power-select-selecteditem
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
dashboard : {selectors: [
{title: 'a', selectorOptions: ['a1', 'a2', 'a3']},
{title: 'b', selectorOptions: ['b1', 'b2', 'b3']},
{title: 'c', selectorOptions: ['c1', 'c2', 'c3']}
]}
});
Selecteds:
{{#each dashboard.selectors as |selector|}}
{{selector.selectedItem}}
{{/each}}
{{#each dashboard.selectors as |selector|}}
<div class="column is-12 object-item">
<div class="card">
<header class="card-header">
<p class="card-header-title">
{{selector.title}}
</p>
</header>
<div class="card-content">
{{#power-select-multiple
placeholder="Vision"
options=selector.selectorOptions
searchEnabled=false
selected=selector.selectedItem
onchange=(action (mut selector.selectedItem)) as |option|}}
{{option}}
{{/power-select-multiple}}
</div>
</div>
</div>
{{/each}}
{
"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-data": "2.12.1",
"ember-power-select": "1.9.6"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment