Skip to content

stefanpenner/ember-redirect-to

Repository files navigation

Ember-redirect-to Build Status

DEPRECATED: Starting with Ember v2.10 this addon is no longer needed and you can just use this.replaceWith to get the correct behavior!

Ever confused by when to use this.transitionTo and this.replaceWith in the redirectwhile trying to preserve history? ...Me too...

This addon makes this.redirectTo available in Routes, which appears to always do the right things.

Usage

ember install ember-redirect-to

In the route you wish to "alias" to another.

// routes/index.js
export default Route.extend({
  redirect() {
    // redirects / -> dashboard
    // correctly chooses transitionTo or replaceWith to ensure the expected history
    this.redirectTo('dashboard');
  }
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published