Skip to content

Instantly share code, notes, and snippets.

@edygar
Forked from locks/application.controller.js
Last active December 15, 2015 01:00
Show Gist options
  • Save edygar/2cbabb3ddde49de32f64 to your computer and use it in GitHub Desktop.
Save edygar/2cbabb3ddde49de32f64 to your computer and use it in GitHub Desktop.
if
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
selected: 0,
options: [1, 2],
actions: {
select(index) {
this.set('selected', index);
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{#each options as |label index|}}
<button {{action "select" index}} class="{{if index selected 'selected'}}" {{action 'toggle'}}>
{{label}} {{if index selected '*'}}
</button>
{{/each}}
<br>
<br>
{
"version": "0.4.17",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment