John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

can i create datamodels in local storage?

ok i see.. you didnt directly answer, but Im assuming then I can map multiple items to one local storage variable which inside i write whatever is needed to save them all and get them individually...

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

can i create datamodels in local storage?

You can but you will overwrite the previous value (if one exists). You need to build an API on top of the standard API to do that.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

can i create datamodels in local storage?

i guess it depends what you mean by overwriting the previous data. If I send one service response with 10 different items, cant i map them all in one local storage item and inside write a JS to list all the items im mapping in it so that later i can retrieve just one by writing a filtering code?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

can i create datamodels in local storage?

And yes, if the same service response continues to come in then it would only be natural im overwriting the data in there. Thats the point

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

can i create datamodels in local storage?

You can do that with JavaScript but not with mapping. The way mapping works, every response item will overwrite the previous one and you will end up with the last one set.

You could map a collection to a JavaScript variable - and there get all the values and save them.

Return to “Issues”