Skip to content

Instantly share code, notes, and snippets.

@pablobm
Last active April 2, 2016 09:47
Show Gist options
  • Save pablobm/e9536ade47300560c83b to your computer and use it in GitHub Desktop.
Save pablobm/e9536ade47300560c83b to your computer and use it in GitHub Desktop.
Arbitrary query params
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: ['foo', 'bar'],
foo: '',
bar: '',
clear: {
isQueryParams: true,
values: {
foo: '',
bar: '',
},
},
arbitrary: {
isQueryParams: true,
values: {
bar: 'two',
},
},
});
<h1>Test with query params</h1>
<p>{{#link-to 'application' clear}}Clear query string{{/link-to}}</p>
<p>{{#link-to (query-params foo='one')}}Link with `foo=one`{{/link-to}}</p>
<p>{{#link-to arbitrary}}Link with arbitrary object (`bar=two`){{/link-to}}</p>
{
"version": "0.7.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment