angular2-local-storage | Angular 2 module that gives access | Storage library
kandi X-RAY | angular2-local-storage Summary
kandi X-RAY | angular2-local-storage Summary
An Angular 2 module that gives access to the browsers local storage
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of angular2-local-storage
angular2-local-storage Key Features
angular2-local-storage Examples and Code Snippets
Community Discussions
Trending Discussions on angular2-local-storage
QUESTION
It took about 10 hours since I am trying some simple jobs using typescript, angular2 and asp core. I will explain the path I reached here and where you have any idea i will appreciate.
First you should consider that I am using a project template from the link bellow:
Then I wanted to add some code to store some data in localStorage.
Some links suggest that I must have access to localStorage very simple. But when I wanted to access localStorage from within the component of angular2, I got this error:
localStorage is not defined
Then I googled a lot for a solution and found libraries below:
But all of them won't work.
Then I tried writing a service will the hope of accessing localStorage easily. Then I created this file:
/ClientApp/app/services/local-storage-service.ts
...ANSWER
Answered 2017-Mar-05 at 09:20For non-module files you're going to have to use relative paths; e.g., ./
, ../
. You don't say where the file is that is trying to import the service in relation to the service. Assuming it's in a parent directory, the path would be ./services/local-storage-service
.
If you're still having problems, you can try using this local storage service.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular2-local-storage
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page