I have an app that is in house using Web API 2 Active Directory for authentication and angularjs on the front end. When a user navigates to the index page I want to route them to /home/users/jdoe
(where jdoe is their AD id). My angularjs route is setup so that user
and jdoe
are parameters:
.when("/events/:type/:value", {
I do this because type can be someone else like category and value will be some category.
Now to start out with the client doesn't know who this user is of course. So I need to make an $http call to get that from the web api 2 and return it. Then somehow use that value in the redirect on "/" route. Since this is the default route and it seems like you can't inject services into config()
how would I be able to set something like this up?
I need a way to setup the redirectTo: 'home/users/' + currentUser
where currentUser was received from an $http call at the start and filled in before the config()
function so the route can use it.