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