How can I store multiple objects in an array and then in local storage so that I can get all the objects when needed using a loop.
Examples of objects:
var newMsg = { sentDate: msgDate, sentTime: msgTime, msgTitle: "message title", msgDesc: "message desc" };
I am currently using the https://github.com/grevory/angular-local-storage#configuration-example angularjs module, but I am struggling to store and retrieve objects from an array.
I tried the following code:
msgArray = []; var savedMsgs = localStorageService.set("wimmtkey", newMsg); msgArray.push(savedMsgs); console.log(savedMsgs);
This displays "true" in the console, but expects to see the saved object. Please also consult on the array to retrieve objects. Thank you
source share