Is there a way to re-initialize the service after logging out?
var app = angular.module('plunker', []);
app.controller('ControllerA', ['$scope','serviceA',function($scope, serviceA) {
$scope.initializeA = function(){
serviceA.initialize("Chris");
};
}]);
This is the service:
app.service('serviceA',function(){
var service={};
service.initialize=function(){}
});
I have multiple services similar to this one. How can I clear all data inside these services when I log out?
Please advise on the best approach to achieve this.