Questions tagged [angular2-localstorage]

11 questions
1
vote
0 answers

local storage value gets overwritten

I have initiated 2 localstorage variables within a typescript function. The second variable holding the value overwrites the first variable. How do I fix it? OnSelectedOppPropStatsChange(TypeId: string, StrSelectedValue: string): void…
Ananya
  • 11
  • 1
1
vote
1 answer

Angular5 - Not able to triggered controller method from window storage event

I'm using Angular5 and I'm not able to triggered controller method from window storage event. In init the controller init, I declare a window storage event like this: window.addEventListener('storage', this.messageReceive); Now when this event is…
Parmod
  • 9
  • 1
1
vote
1 answer

How to return as observer from localStorage or an other observer in Angular2?

Here is my "loantype" service get() function: get() { return new Observable(observer => { let response; if ( localStorage.getItem('loantypes_are_valid') === '1' ) { response = JSON.parse(localStorage.getItem('loantypes') || '[]'); …
netdjw
  • 5,419
  • 21
  • 88
  • 162
1
vote
1 answer

Could not resolve 'angular2-localstorage' Angular 2 Ionic 2 RC1

Hello I try to use in my App LocalStorage. I'm installed it. And use. But the compiller Error said: bundle failed: Could not resolve 'angular2-localstorage/WebStorage'; I imported it: import { LocalStorage } from "angular2-localstorage/WebStorage";…
Alexander Zakusilo
  • 1,466
  • 3
  • 16
  • 34
0
votes
0 answers

angular 2 login flow with localStorage and http api call

im pretty new to angular 2 and im currently trying to get my login flow done. Im posting user credentials to api and receive jwt token. then i request user details with this token and store all the information in localStorage, but im not sure if its…
mrvnklm
  • 1,348
  • 2
  • 10
  • 19
0
votes
2 answers

Save data to localstorage, display it by innerHTML ,if there is nothing in the data,show the original text of span(Visitors)

I've made this code for saving a form data to localstorage