Store some data in client side which can be accessed across angularjs app -


hi new angularjs. @ start of app need hit api , store data in client side should accessible across controllers , in config.

can please suggest whats best approach.

here have tried:

service: issue every time call , call api.

i want call once , store it. fine calling on page refresh.

value: cannot accessed in config.

thanks.

you can store data in angular js localstorage.

ypu can add data in localstorage , them anywhere in app , if want ,you can remove localstorage also. example

localstorage.setitem('test', data.item); localstorage.getitem('test') localstorage.removeitem('test'); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -