加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

AngularJS ui-router:强制重新加载

发布时间:2020-12-17 08:09:20 所属栏目:安全 来源:网络整理
导读:我有一个AngularJS应用程序从index.html开始,并使用ui-router。基于触发器,我想重新加载完整的页面。我试过了: $state.go($state.current,$stateParams,{ reload: true,inherit: false,notify: true}); 但这不行。它不会重新加载我的初始index.html。 我
我有一个AngularJS应用程序从index.html开始,并使用ui-router。基于触发器,我想重新加载完整的页面。我试过了:
$state.go($state.current,$stateParams,{
    reload: true,inherit: false,notify: true
});

但这不行。它不会重新加载我的初始index.html。

我可以:

window.location.href = "index.html";

但是,我在我的初始页面,而不是当前的状态。

应该设置window.location.href到index.html与查询字符串参数指定当前位置?如果我这样做,我如何导航到这个位置?

目前的诀窍是:

$state.go($state.current.name,$state.params,{ reload: true });

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读