Page 3 of 3

can i create datamodels in local storage?

Posted: Mon May 27, 2013 10:58 pm
by John Herdean

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...


can i create datamodels in local storage?

Posted: Tue May 28, 2013 2:34 am
by maxkatz

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.


can i create datamodels in local storage?

Posted: Tue May 28, 2013 3:27 am
by John Herdean

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?


can i create datamodels in local storage?

Posted: Tue May 28, 2013 3:28 am
by John Herdean

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


can i create datamodels in local storage?

Posted: Tue May 28, 2013 4:27 am
by maxkatz

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.