I currently store a session variable as a JSON value in my home.component.ts
. This variable needs to be accessed in various locations within the application.
This is my code snippet:
.do(data => sessionStorage.setItem('homes', JSON.stringify(data)))
var session = sessionStorage.getItem('homes');
What is the best way to access the session
variable across the entire application?