The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

redirectTo

redirectTo

3:45
In AngularJS redirectTo is often assigned a simple static string and thus points invariably to one location (redirectTo: '/mypath'). You can customize this, by setting redirectTo as a function, which arguments are the route params. For instance, if you hit the route "/pizza/peperoni", you can compose your redirection to be "/pizzas", or whatever suits your needs
Watch this lesson now
Avatar
egghead.io

In AngularJS redirectTo is often assigned a simple static string and thus points invariably to one location (redirectTo: '/mypath'). You can customize this, by setting redirectTo as a function, which arguments are the route params. For instance, if you hit the route "/pizza/peperoni", you can compose your redirection to be "/pizzas", or whatever suits your needs

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?