cms/app-client/app/routes/application.js
author nowmad@23.1.168.192.in-addr.arpa
Fri, 18 Dec 2015 15:19:19 +0100
changeset 74 2bd46d0b2c80
parent 42 7d091abf82fd
child 81 848e4a5ad4d9
permissions -rw-r--r--
Propagate the current query param to the new route (necessary when the route change comes from outside the app)

import Ember from 'ember';

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 });
    }
  }
});