Created
October 26, 2013 19:58
-
-
Save matejkramny/7173798 to your computer and use it in GitHub Desktop.
Logout angular ui-router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.config(function($stateProvider, $urlRouterProvider, $locationProvider) { | |
$stateProvider.state('logout', { | |
url: '/logout', | |
controller: function($scope, $route) { | |
$route.reload() | |
} | |
}) |
Hey, thanks for this. It helped me alot. Here's the version I used:
// Sign IN
.state('sign-out', {
url: '/sign-out',
controller: function($state, User) {
User.signOut();
$state.go('welcome');
},
data: {
requireLogin: false,
}
})
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to avoid including the
angular-route
module I guess you could do: