Is there a way to use $location.path for redirection in angularjs? I have the configuration below:
ngModule.config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
// Note: when adding a templateUrl, make sure it's not a redirect but the full URL
$stateProvider
.state('logged-off', {
url: '/logged_off',
templateUrl: function () {
return '/partials/logged_off/';
}
});
}]);
Now :
$location.path('logged_off');
works fine, but instead of referencing the url, how can I refer to the state (in this case logged-off)?