Skip to content

Instantly share code, notes, and snippets.

@rlivsey
Created September 18, 2018 13:21
Show Gist options
  • Save rlivsey/97f2c3d7596c97d51846033ad23d75f2 to your computer and use it in GitHub Desktop.
Save rlivsey/97f2c3d7596c97d51846033ad23d75f2 to your computer and use it in GitHub Desktop.
Sticky Query Params Issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['qux'],
qux: null
});
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('foo', { path: ':foo' }, function() {
this.route('bar', function() {
this.route('baz');
});
});
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return new Ember.RSVP.Promise(resolve => {
setTimeout(resolve, 1);
});
},
});
<h1>Sticky query params issue</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{link-to 'Go!' 'foo.bar.baz' 'foo' (query-params qux='abc')}}
{{link-to 'Baz' 'foo.bar.baz' id='baz-link'}}
&larr; This should have a query param
{
"version": "0.15.0",
"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.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment