why is it that I am not redirected to other URL when I use angular.js $location.path ?
.controller('CheckCtrl', function($scope, $localStorage, $location) {
$scope.check = function(){
if($localStorage.hasOwnProperty("accessToken") === true) {
alert("CheckCtrl logged in" + $localStorage.accessToken);
$location.path("/post-report");
}else{
alert("CheckCtrl not logged in" + $localStorage.accessToken);
$location.path("home.login");
}
};
})
Even though $localStorage.hasOwnProperty
is true already since it contains token from Facebook.
I also try $location.reload()
but still no luck.