3

I want page to be refreshed/reloaded after logout (message on screen is visible for 5 seconds). Current code won't refresh it so I'm still seeing user's name in header instead of something else like Login button.

.controller('logout', ['$scope', 'location', 'config', 'auth', '$timeout', '$route', function($scope, location, config, auth, $timeout, $route) {
    auth.isValid($scope, function() {
        auth.logout(function() {
            $timeout(function() {
                location.path('/login');
                $route.reload();
            }, 5000);
        });
    });
}])

I've checked this post but nothing changes.

Community
  • 1
  • 1
BentCoder
  • 12,257
  • 22
  • 93
  • 165

1 Answers1

-1

You can use JavaScript location for this.

location.reload();