Search code examples
isomorphic-javascriptrendr

rendr isomorphic framework trigger route


I'd like to trigger a route change via javascript in RendrJS. My use case is that the user is on the /register page and upon a successful registration attempt I would like to direct the user to the /account page. Whats the best way to achieve this?


Solution

  • Best practice in Rendr is to use redirectTo since it's isomorphic.

    Inside a controller, we use:

    this.redirectTo('/some/path');
    

    Inside a view, we use:

    this.app.router.redirectTo('/some/path');