简体   繁体   English

如何在iframe中维护角度应用的页面重新加载路线?

[英]How do you maintain the route on page reload for an angular app in an iframe?

I have an angular app loaded inside a Facebook canvas. 我在Facebook画布中加载了一个有角度的应用程序。 When I refresh the page, the angular app loads the root url at / everytime. 当我刷新页面时,Angular应用程序每次都会在/加载根网址。 If I navigate to another route and I reload the page, how I maintain the state? 如果导航到另一条路线并重新加载页面,如何保持状态?

The libraries I am using are AngularJS and UI Router. 我使用的库是AngularJS和UI Router。

Here's an example 这是一个例子

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    <title>Test</title>

  </head>
<body>

  <iframe src="http://christopherthielen.github.io/ui-router-extras/example/sticky/index.html" height="1500" width="1500" frameborder="0"></iframe>


</body>
</html>

创建一个会话cookie或有时间限制的cookie,在状态更改时保存当前状态-在页面加载时检查cookie-如果存在,请导航至所需状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM