Already read this topic Angular not changing the path and Angular location path not working But still not get the idea why this thing happen.
Here is my function in controller.
$scope.logout = function () {
sessionService.destroy('isLoggedIn');
sessionService.destroy('role');
sessionService.destroy('sessionToken');
if(sessionService.get('sessionToken') != null){
//$scope.isLoggedIn = true;
$scope.hasNotsignedIn = false;
}else {
$scope.hasNotsignedIn = true;
//$scope.isLoggedIn = false;
}
$location.path("/"); //this not working
}
$location
already injected to controller and route already define. I have other $location.path
in other function which is work correctly.
So is something missing or wrong with my code?