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
Post a Comment