Home > Enterprise >  retain angular variables after page refresh without localStorage?
retain angular variables after page refresh without localStorage?

Time:04-02

How to retain angular variables after page refresh without localStorage ?

localStorage.setItem("key", "value"); localStorage.getItem("key");

CodePudding user response:

You can only achieve this by using session storage or local storage. Another way to do it is to store data in a real time database, using a real time database will make data available through all devices

CodePudding user response:

You can add them to the URL as parameters then on refresh, read them from route snapshot.

  • Related