AngularJS UI路由器:重装武力 [英] AngularJS ui-router: force reload
问题描述
我有一个AngularJS应用起始于index.html,然后使用UI的路由器。基于触发器我要重新加载整个页面。我想:
I have an AngularJS app starting at index.html and using ui-router. Based on a trigger I want to reload the complete page. I tried:
$state.go($state.current, $stateParams, {
reload: true,
inherit: false,
notify: true
});
但是,这并不工作。它不重装我最初的index.html。
But that does not work. It doesn't reload my initial index.html.
我可以这样做:
window.location.href = "index.html";
但后来我为我的初始页面上的,而不是当前的状态。
But then I'm on my initial page, not the current state.
如若一组 window.location.href
到 index.html的
与查询字符串参数指定的当前位置?如果我这样做,我怎么能浏览到这个位置?
Should a set window.location.href
to index.html
with query string parameters specifying current location? If I do that, how can I navigate to this location?
推荐答案
目前的诀窍是:
$ state.go($ state.current.name,$ state.params,{重装:真});
$state.go($state.current.name, $state.params, { reload: true });
这篇关于AngularJS UI路由器:重装武力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!