Skip to content

Instantly share code, notes, and snippets.

@dfreeman
Created June 20, 2018 14:25
Show Gist options
  • Save dfreeman/eeece40e404fd674e10664eb7510f33c to your computer and use it in GitHub Desktop.
Save dfreeman/eeece40e404fd674e10664eb7510f33c to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
items: [1, 2, 3],
remove() {
this.items.removeAt(0);
},
reset() {
this.set('items', [1, 2, 3]);
}
});
<button onclick={{action remove}}>Remove</button>
<button onclick={{action reset}}>Reset</button>
{{#each items key='@index' as |item|}}
{{item}}
{{/each}}
{
"version": "0.14.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": "2.18.2",
"ember-template-compiler": "2.18.2",
"ember-testing": "2.18.2"
},
"addons": {
"ember-data": "2.18.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment