如何使用 angular-ui-router 重新加载 Controller 和整个端?
$state.reload() or $state.go('myState')
不起作用。唯一有效的方法是:
$state.go('anotherState');
$state.go('myState');
- 去另一个州然后回来。然后,正确地重新加载 View 。没有这个技巧怎么办?
问候
最佳答案
您可以在不刷新页面的情况下使用它。这将重新加载 View :
$state.transitionTo($state.current, $stateParams, {
reload: true,
inherit: false,
notify: true
});
或者试试这个
$state.go($state.current.name,{},{reload: $state.current.name});
关于javascript - 如何使用 angular-ui-router 重新加载状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46298528/