Skip to content

Instantly share code, notes, and snippets.

@bardzusny
Created February 6, 2019 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bardzusny/b83b23e6daf9a6e900f1a0bbb90dc431 to your computer and use it in GitHub Desktop.
Save bardzusny/b83b23e6daf9a6e900f1a0bbb90dc431 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
conditions: [],
actions: {
addCondition(e) {
this.conditions.pushObject(e.target.value);
}
}
});
<ul>
{{#each conditions as |cond|}}
<li>{{cond}}</li>
{{/each}}
</ul>
<select onchange={{action "addCondition"}} value={{conditionType}}>
<option value="" disabled hidden selected="selected">
Add condition
</option>
<option value="1" selected={{eq "1" conditionType}}>
Condition 1
</option>
<option value="2" selected={{eq "2" conditionType}}>
Condition 2
</option>
</select>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2",
"ember-truth-helpers": "2.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment