gpt4 book ai didi

刷新页面时 AngularJS 数据丢失

转载 作者:行者123 更新时间:2023-12-03 08:16:49 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





retain angular variables after page refresh

(5 个回答)


5年前关闭。




每次刷新页面时,AngularJS 变量中的数据都会丢失。如何在不使用 cookie 的情况下保留它们?任何人都可以帮助我提供一种方法吗?它不同于previous question因为我对不使用 cookie 的解决方案感兴趣。

最佳答案

对于小于 4k 的数据量,您可以使用 $cookieStore。
如果不止于此,您将需要查看 HTML5 localStorage

For more details please go through this post you will find different options of storage with comparison http://www.html5rocks.com/en/tutorials/offline/storage/

关于刷新页面时 AngularJS 数据丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35569807/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com