Angularjs UI引导程序会在打开时临时更改URL,并在关闭时恢复为原始URL [英] Angularjs UI bootstrap temporarily change URL on open and revert to original URL on close

查看:92
本文介绍了Angularjs UI引导程序会在打开时临时更改URL,并在关闭时恢复为原始URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在打开ui引导模态时临时更改浏览器的url(后面的页面应保持原样,只有url会更改).关闭模式后,网址应恢复为原始网址.

I want to temporarily change the browser url when the ui bootstrap modal is opened ( The page behind should remain as is, only the url changes ). When the modal is closed the url should be reverted back to the original one.

步骤:

  1. 用户加载页面
    • url:xyz.com/home
  1. User loads the page
    • url : xyz.com/home
  • url:xyz.com/detail/123
  • 可能的解决方案:使用html5推送状态更改网址
  • 问题:Angular ui-router尝试根据更改后的URL运行其路由,最终更改了后台页面.
  • url:xyz.com/home
  • 可能的解决方案:html5弹出状态
  • 问题:重新加载后台页面,这会杀死目的

示例实现:Pinterest引脚及其引脚详细信息弹出窗口.

Example implementation : Pinterest pins and their pin details popup.

推荐答案

设法使用 查看全文

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