view raw
Daniel Stradowski Daniel Stradowski - 8 months ago 274
TypeScript Question

Access HTML5 local storage from Angular2

I'm following this tutorial: about authentication in Angular2.

I've the issue with this part:

import localStorage from 'localStorage';

I've read somewhere else that I should use this library to access local storage in HTML5. Is it really the only option? Can I access HTML5 local storage from angular2 without using extra modules?


You can use localStorage directly in your service without import localStorage from 'localStorage';.