javascript - Need to store Objects, so that on refresh, the object should be available in angularJS? -


i have service implemented. , i'm creating 2 objects. after refresh values becoming null.

how should store these objects, can access them after refresh also.

var userpool = new awscognito.cognitoidentityserviceprovider.cognitouserpool(xyz); var cognitouser = awscognito.authenticate(userpool); 

this implemented in service, run once. need store these objects, can access them after refresh.

for data persistence within app, services should used.

for data persistence within browser, localstorage should used.

read localstorage: https://developer.mozilla.org/en/docs/web/api/window/localstorage

an angular library localstorage: https://npmjs.com/package/angular-local-storage


Comments

Popular posts from this blog

c++ - CPP, 'X' button listener -

shared memory - gstreamer shmsrc and shmsink with h264 data -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -