Home How to store application level variable value in angular 4 and avaialble in all component
Reply: 1

How to store application level variable value in angular 4 and avaialble in all component

Jayendra Bariya
1#
Jayendra Bariya Published in 2018-01-11 10:38:57Z

I get JWT token from login api. After that in want to store it to somewhere to avaialable in every component and service and also available from Interceptor to attach it to each http request with Authentication Header.

In service, app level const, static variable, and Injector value are gone after hard refresh.

Currently i am using localstorage but i want some other way.

Plz help me...

Prabhu
2#
Prabhu Reply to 2018-01-11 10:48:50Z

Use local storage variable, then access it from every component.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306211 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO