In ember.js how do you dynamically update a query param?
export default Ember.Controller.extend({
myQuery: "test",
queryParams: ["myQuery"],
actions: {
click() {
this.set("myQuery", "update query param");
}
}
});
export default Ember.Route.extend({
queryParams: {
myQuery: { refreshModel: true }
},
model(params) {
console.log(params)
}
});
When the action is fired the model hook should be called again, unless I am wrong?
Please find an example here, navigate to the /test
route and click the button. Inside the console you can see that the model hook is not fired again.
Aucun commentaire:
Enregistrer un commentaire