Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember transitionTo query params does not update the URL

Tags:

ember.js

I'm using Ember 1.9.1 and having an issue when transitioning to a route with query params.

The queryParams don't appear in the url.

I got http://localhost:8080/login instead of having http://localhost:8080/login?email=myemail&uuid=myuuid

App.MyRouteRoute = Ember.route.extend({ 

redirect: function (model, transition) {
    this.transitionTo('login', {
        queryParams: {
            uuid: model.get('uuid'),
            email: model.get('email')
        }
    }); 
}
like image 333
Xiu Avatar asked Sep 12 '15 17:09

Xiu


1 Answers

You need to specify queryParams and uuid, email in LoginController:

App.LoginController = Ember.Controller.extend({
  queryParams: ['uuid', 'email'],
  uuid: null,
  email: null
});

Working demo.

http://emberjs.jsbin.com/zacagazuwi/1#/login?email=test%40gmail.com&uuid=myuuid

like image 166
Daniel Kmak Avatar answered Nov 15 '22 04:11

Daniel Kmak