使用 angular-ui-router 保留 UI 的动作/状态 [英] preserve the actions/state of UI with angular-ui-router

查看:27
本文介绍了使用 angular-ui-router 保留 UI 的动作/状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

angular-ui-router 有什么办法可以像大多数原生应用一样实际保留 UI 的状态吗?例如,如果我在主视图中单击展开的手风琴列表,然后单击列表中的该项目并导航到另一个视图.接下来,我决定回到主页视图.我想要的结果是,当导航回主视图而不是刷新页面时,手风琴列表仍会展开.

有没有办法保留我们在视图之间来回导航的 UI 的操作/状态?

解决方案

Checkout ui-router 额外.我认为深度状态重定向"可能是您正在寻找的.

Is there any way with angular-ui-router to actually preserve the state of the UI like most native apps do? For example, if I was on the home view and I clicked an accordion list which expanded, then clicked on that item inside the list and navigated to another view. Next, I decide to go back to the home view. The result I would like to have is the accordion list still expanded when navigating back to the home view rather than refreshing the page.

Is there any way to preserve the actions/state of UI we navigating back and forth between views?

解决方案

Checkout ui-router extras. I think "Deep State Redirect" probably what you are looking for.

这篇关于使用 angular-ui-router 保留 UI 的动作/状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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