Skip to content

Instantly share code, notes, and snippets.

@jenweber
Last active May 7, 2018 01:48
Show Gist options
  • Save jenweber/5c5574c134199d3377888d33252c5736 to your computer and use it in GitHub Desktop.
Save jenweber/5c5574c134199d3377888d33252c5736 to your computer and use it in GitHub Desktop.
Example controller
import Ember from 'ember';
// in Ember 3.x, you would use import Controller from '@ember/controller';
export default Ember.Controller.extend({
// in Ember 3.x, use export default Controller.extend({
blogPostTopic: '',
queryParams: [{
blogPostTopic: {
type: 'string',
refreshModel: true
// refreshModel says whether the model hook on the route should be re-run if the query parameter changes. Its default is false!
}
}],
actions: {
changeQueryParam(topic) {
this.set('blogPostTopic', topic)
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment