Saturday, May 9, 2015

Accessing query params from a route in Ember CLI in May 2015

I just spent 90 minutes trying to figure this out so hopefully this will help other people avoid similar pain! If you want to access query params from a route in Ember it's actually really simple: just declare the query params in the controller first.

E.g.
export default Ember.Controller.extend({

queryParams: ['city', 'company'],

And then in the route:
model: function(params) {
var city = params.city;
var company =  params.company;
 

No comments:

Post a Comment