mardi 31 mars 2015

"TransitionTo" affects page refresh in Ember

My ember application contains a parent route with two nested routes. After fetching the parent route's model I'll transition to one of the nested routes by default.


The router is as follows



this.resource('parent', {path: '/parent'}, function() {
this.route('route1', {path: '/route1'});
this.route('route2', {path: '/route2'});
});


In the parent route



redirect: function()
{
this.transitionTo('parent.route1');
}


Now this works perfectly fine. But the problem arises when I refresh the page while being on the route "#/parent/route2".


Actually I should get the contents of "route2" but the transitionTo makes the route to render "route1". How can I handle this ?





Aucun commentaire:

Enregistrer un commentaire