在我的項目簽出後,我重定向用戶去'登錄'狀態。但是,如果我試圖再次登錄而不刷新頁面,則登錄不會發生。一旦我刷新頁面,它就會工作。所以請幫助我如何解決這個問題。下面我分享代碼。如何在成功註銷angularJs後重新加載登錄頁面?
logoutController.js
angular.module("adminsuite").controller("headerController",['AuthenticationService','$state','$rootScope','$cookieStore','$scope',function(AuthenticationService,$state,$rootScope,$cookieStore,$scope){
$scope.header = $state.current.name;
$rootScope.global = {
search: '',
newsurvey: false
};
$scope.logout = function(){
//$scope.dataLoading = true;
AuthenticationService.ClearCredentials();
$state.go('login');
console.log($cookieStore.get('globals'));
//$state.go('login');
};
}]);
signout.html
<a ng-click='logout()'><p class="small-font"><img src = "images/signout.png" class="thumbpreImg" alt = "logoutImg"> Log out</p></a>
我打電話的logoutController在signout.html頁
我必須在logoutController編寫上面的代碼沒有?? – Kishan
謝謝,第三個人爲我工作。 – Kishan