angular-2-local-storage icon indicating copy to clipboard operation
angular-2-local-storage copied to clipboard

How to set and get values

Open alaksandarjesus opened this issue 7 years ago • 2 comments

Considering myself as a noob and couldnt figure out how to use setItem and getItem. I am getting error at this point. this.localStorage.setItems$.subscribe("cities", "Hello world");

alaksandarjesus avatar Mar 12 '17 23:03 alaksandarjesus

Try this

this.localStorageService.set('cities','Hello world');

Luciaisacomputer avatar May 13 '17 14:05 Luciaisacomputer

And for getting:

this.localStorageService.get('cities');

Luciaisacomputer avatar May 13 '17 16:05 Luciaisacomputer