Ionic local storage vs using service

后端 未结 3 1786
面向向阳花
面向向阳花 2020-12-21 10:47

I am finding myself placing all my data from my api calls in the device local storage and I am not sure if it matters whether I put things in local storage vs putting them i

3条回答
  •  情书的邮戳
    2020-12-21 11:03

    Data stored in local storage is persistent. So, if you reload you web app the data in local storage is till there. Local storage is typically limited to 5MB. See this

    Services are in memory constructs. So, if you place anything in service it is in the browser's memory and are lost when refreshing the browser.

    So it depends on what you need.

提交回复
热议问题