gpt4 book ai didi

AngularJS UI 路由器 : force reload

转载 作者:行者123 更新时间:2023-12-02 18:55:31 25 4
gpt4 key购买 nike

我有一个从index.html开始并使用ui-router的AngularJS应用程序。基于触发器我想重新加载整个页面。我尝试过:

$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 });

关于AngularJS UI 路由器 : force reload,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23257887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com