Open valichek opened 6 years ago
@valichek can you give me a real example? It seems like it could be useful but I can't think of a valid use case.
@davismj real use case: we have ACLs, child router is configured with all possible routes, navigation menu is filtered according to ACL, user can switch role any time, depending on role default route in child router can be different.
@davismj another use case, consider we want to handle /shop/SHOP_ID/admin
route and redirect to /user/USER_ID/profile
. This is not good example from app side, but shows ability to "convert" links
@valichek and AuthorizeStep
doesn't solve this use case?
@davismj AuthorizeStep
is good only for AppRouter
, but not for its childRouters
We have routes that look like '/clients/module' and want to change to '/clients/:clientId/module' but we have a lot of places where the old routes still exist (emails we sent, user's bookmarks, etc.) that are beyond our control. The solution proposed here would help us to create a dynamic redirector that would capture any navigation event to the old URL, inspect the current user's state information, and redirect to the new url with the :clientId parameter in place.
I'm submitting a feature request
Having possibility to redirect from route handler would be a nice feature For example sometimes I need redirect with some logic. This could look like following:
Current behavior:
Now it's possible to handle redirect in modelView handlers like canActivate(). So I need to create dummy module and place redirection logic to
canActivate()
.