I need to store data in the browser's session and retrieve the data until the session exits. How do you use local and session storage in Angular 2?
The standard localStorage
API should be available, just do e.g.:
localStorage.setItem('whatever', 'something');
It's pretty widely supported.
Note that you will need to add "dom"
to the "lib"
array in your tsconfig.json
if you don't already have it.