jeudi 20 juillet 2017

From the router, how can I route to a completely different parent route in EmberJS

Suppose I have the following URL.

http://ift.tt/2uDRbn4

And in my router, it might look something like this:

this.route('foo',  function() {
    this.route('fooo');
    this.route('foooo');
    this.route('abc', function() {
      this.route('def');
      this.route('def, {path: 'def.html'});
       // Some other routes
    }
    // Some other routes
}
// Some other Routes

So what happens now if I want my foo/abc/def to redirect to somewhere COMPLETELY different. Like, for example, bar/uvw/xyz. How can I redirect to there? Is there a way to do it from a the router? I could write transition logic within the /foo/abc/def route but that seems a bit messy.

The reason I need to do this is because I'm transitioning one of our companies websites to a new Ember site. And we want to change the routes to some of our products but make sure people who have saved links to those webpages won't get dead-links.




Aucun commentaire:

Enregistrer un commentaire