I have two routes : 1. login 2. others.
Everytime a route changes, I check if I am going to login or other route.
At this point I have to make an API call here to check if I am logged in or not to handle route redirection based upon response.
Now in the config section where I am managing this, I need a URL for an endpoint.
This endpoint is passed to a utility function that adds base path and API version to form the complete URL.
Now this is something that I want to keep as a utility function. I kept it in rootScope initially but then later decided to move it to a service but I couldn't inject it here.