search

Home  >  Q&A  >  body text

angular.js - 数据存储,你们是放在localstorage还是service

数据存储,你们是放在localstorage还是service,能讲解一下优劣势吗?
比如你登陆之后,登陆的信息全局都用得到。你们一般是放在localstorage里面还是service里面。如果数据比较大呢,那种存储性能比较好一点。

过去多啦不再A梦过去多啦不再A梦2749 days ago703

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-05-15 17:03:01

    Put it in the service. It consumes a little memory, but it is much safer. Localstorage is not used much, and in practice it is rarely used by others. The specific way localstorage stores data is not clear. If other applications can also exist in it, they may affect each other.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-15 17:03:01

    localstorage exists locally
    What do you mean by this service? It is stored on the server. How to compare this depends on your needs and the use of the data

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-15 17:03:01

    I have encountered pitfalls before that on iOS devices, incognito mode, localstorage and session storage cannot be used, and cannot be rewritten. . . .

    reply
    0
  • Cancelreply