The Angular UI-Router documentation uses the following example for redirecting:
$urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {
if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {
$state.transitionTo(state, $match, false);
}
}]);
https://github.com/angular-ui/ui-router/wiki/URL-Routing#when-for-redirection
My question is about state.url. You can get a state's url by using the $state service, e.g. $state.get('home')
But this is a service and is not available in the config phase, so how would I go about obtaining a states url to put it as the first parameter of $urlRouterProvider.when?