angularjs - Can I reload app without refreshing view? -
i using ui router in application, , wondering if can reload - or destroy services when user logging out, without refreshing view? far, when user logging out, backend logs him out, , redirected login view. however, of services still working. ideas?
thanks
//controller logout button called .controller("ctrl", function(destroyservice){ this.logout = function(){ //probably ajax request logout server. $http.post("logouturl", userid) .then(function(){ destroyservice.destroyall(); $state.go("loginpage"); }); }; }) .service("destroyservice", ["service1", "service2", function(service1, service2){ this.destroyall = function(){ service1.destroyall(); service2.destroyall(); }; }]);
Comments
Post a Comment