Skip to content

Instantly share code, notes, and snippets.

@kimroen
Last active August 29, 2015 14:28
Show Gist options
  • Save kimroen/49b18a5dd867cbda3a7d to your computer and use it in GitHub Desktop.
Save kimroen/49b18a5dd867cbda3a7d to your computer and use it in GitHub Desktop.
Basic QueryParams
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
queryParams: ['name'],
name: 'Kim'
});
import Ember from 'ember';
Ember.Route.reopen({_actions:{}});
export default Ember.Route.extend({
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
Current name: {{name}}.<br>
<ul>
<li>{{link-to 'Change name to "Rob"' 'index' (query-params name='Rob')}}</li>
<li>{{link-to 'Change name to "Kim"' 'index' (query-params name='Kim')}}</li>
<li>{{link-to 'Change name to "Matthew"' 'index' (query-params name='Matthew')}}</li>
</ul>
<br>
<br>
{
"version": "0.4.8",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.0.1/ember.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.8/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment