Skip to content

Instantly share code, notes, and snippets.

@Sinled
Last active April 27, 2016 19:46
Show Gist options
  • Save Sinled/840744c70fc41aaf7107788c19ddd006 to your computer and use it in GitHub Desktop.
Save Sinled/840744c70fc41aaf7107788c19ddd006 to your computer and use it in GitHub Desktop.
qp-array-regression
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
refresh() {
this.send('doSomeStuff');
},
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['field'],
field: ['some', 'field'],
actions: {
refresh() {
this.send('refreshRoute');
},
}
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none'
});
Router.map(function() {
this.route('parent', function() {
this.route('child');
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
doSomeStuff() {
this.send('refreshRoute');
this.transitionTo('parent');
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
console.log(params)
},
serializeQueryParam(...args) {
console.log('serializeQueryParam');
return this._super(...args);
},
deserializeQueryParam(...args) {
console.log('deserializeQueryParam');
this._super(...args);
},
actions: {
refreshRoute() {
this.refresh()
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
{{link-to 'parent' 'parent'}},
{{link-to 'child' 'parent.child'}}
<br>
{{outlet}}
<br>
<br>
<h2>Child</h2>
<hr>
<br>
<button type="button" onclick={{action 'refresh'}}>refresh and transition to parent</button>
<h1>Parent</h1>
<hr>
<br>
<br>
{{outlet}}
{
"version": "0.7.2",
"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.4.4",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "2.4.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment