Clear $scope on logout in Angular js

后端 未结 5 1306
深忆病人
深忆病人 2021-01-19 10:59

In my controller I am storing data as $scope.$parent.dossierSummaries = data; but after log out and login the application $scope.$parent.dossierSummaries<

5条回答
  •  情书的邮戳
    2021-01-19 11:50

    if you don't mind a slight screen flickering on logout, you can refresh the page using a method like this:

    $window.location.replace($window.location.toString().split('#')[0]);
    

    this would clear out all the $scope and $rootScope variables, and in my case has solved the issue.

提交回复
热议问题