Skip to content

Instantly share code, notes, and snippets.

@lan0
Last active August 31, 2016 18:32
Show Gist options
  • Select an option

  • Save lan0/c0f6b0efd71731ecb7e474ddedc7a7a4 to your computer and use it in GitHub Desktop.

Select an option

Save lan0/c0f6b0efd71731ecb7e474ddedc7a7a4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['array', 'other'],
array: [],
other: null,
actions: {
setArray() {
this.set('array', [1]);
},
refresh() {
this.set('other', 'foo');
this.send('refreshRoute');
},
},
});
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
refreshRoute() {
this.refresh();
},
},
});
<button {{action "setArray"}}>set array</button>
<button {{action "refresh"}}>refresh</button>
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment