Last active
May 7, 2018 01:48
-
-
Save jenweber/5c5574c134199d3377888d33252c5736 to your computer and use it in GitHub Desktop.
Example controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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