JavaScript AngularJS - cleanup the whole application

In Angularjs, I keep lot of data in my services so that the server calls can be reduced and the data can be picked from local variables. This leads to data being persisted in the application till user refresh screen or close the tab. This is hazard to both security and performance as lot of data is kept in browser memory.

I want to clean up all the services on certain event (like logout) so that the cached data is cleaned up from the browser memory.

Note: I do not want to refresh the screen (window.location.reload) and I have lot of services in my application already. So need some solution with minimum effort.

Answer:1

I've just learnt about Getters/Setters for objects and decided to play with it. However, I tried to put a Getter in an array and failed to do so. Is it not possible or am I just doing something wrong? ...

I've just learnt about Getters/Setters for objects and decided to play with it. However, I tried to put a Getter in an array and failed to do so. Is it not possible or am I just doing something wrong? ...

I have a fairly simple webpack set up with a bit of a twist. I have a few different ways I can think of to create my intended behavior, but I'm wondering if there are better approaches (I'm still ...

I have a fairly simple webpack set up with a bit of a twist. I have a few different ways I can think of to create my intended behavior, but I'm wondering if there are better approaches (I'm still ...

  1. vue manually trigger watch
  2. angularjs manually trigger watch

I know it is possible to override functions in JS, however is it possible to override implementation of conditional statements like ''if''. Update As asked by some comments, I am building a chrome ...

I know it is possible to override functions in JS, however is it possible to override implementation of conditional statements like ''if''. Update As asked by some comments, I am building a chrome ...

I am very new to software development. I am creating a paragraph that when you click a button it will display a Spanish version of text instead of English. The English version will load, right now ...

I am very new to software development. I am creating a paragraph that when you click a button it will display a Spanish version of text instead of English. The English version will load, right now ...