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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -