Propagate the current query param to the new route (necessary when the route change comes from outside the app)
authornowmad@23.1.168.192.in-addr.arpa
Fri, 18 Dec 2015 15:19:19 +0100
changeset 74 2bd46d0b2c80
parent 73 79a23f4911f9
child 75 0e2f3e4730ac
Propagate the current query param to the new route (necessary when the route change comes from outside the app)
cms/app-client/app/routes/application.js
--- a/cms/app-client/app/routes/application.js	Thu Dec 17 13:11:40 2015 +0100
+++ b/cms/app-client/app/routes/application.js	Fri Dec 18 15:19:19 2015 +0100
@@ -3,5 +3,15 @@
 export default Ember.Route.extend({
   model() {
     return this.store.findAll('sound');
+  },
+  actions: {
+    willTransition: function(transition) {
+      var _this = this;
+      var queryParams = {};
+      this.controller.get('queryParams').map(function(elt, index){
+        queryParams[elt] = _this.controller.get(elt);
+      });
+      this.transitionTo({ queryParams: queryParams });
+    }
   }
 });