I have a set of routes like this:
/users/:type/:id
/users/admin/:id
/user/manager/:id
Now all of these use the same component. The catch is, admin and manager can see some extra stuff based on their type. Assuming I don't have a way to get these from user roles and then show the relevant information, can I use the type route param to identify if the user is admin, manager or any other type of user?
Essentially, in my init function, I am setting something like this:
this.userType = params.userType;
This will work in case of first route as we have a param set for type. Can I tell angular that the value admin and manager are actually the value of param type?
you can use activatedroute to get the query params
first in the constructor you have to declare activateroute something like this
Import activated route and then on ngonit you write the following code to get the values