在刷新页面时保留页面数据 [英] Retain page data on refreshing the page

查看:110
本文介绍了在刷新页面时保留页面数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手.我正在使用获取对象列表并将其显示在第一页上的服务.然后根据单击的对象,在下一页上设置选项卡标题.但是,当我刷新页面时,列表的范围丢失了,并且选项卡标题引发了异常,导致页面无法显示信息.即使刷新第二页,是否可以保留上一个屏幕上单击了哪个对象的信息?

I am new to angular. I am using a service which gets a list of objects and displays them on the 1st page. Then based on what object was clicked, I am setting the tab header on the next page. But while I am refreshing the page the scope of the list is lost and the tab header is throwing the exception resulting the page to not display the information. Is there any way to retain the information that which object was clicked on previous screen even when refreshing the 2nd page?

推荐答案

您可以使用角度本地存储

You can make use of angular local storage

Angular本地存储

示例用法:

使用本地存储的示例

这篇关于在刷新页面时保留页面数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆