如何重定向到另一个页面并在angularjs中刷新它

How to redirect to another page and refresh it in angularjs?

本文关键字:angularjs 刷新 重定向 另一个      更新时间:2023-09-26

点击按钮,我正在调用类似的函数

<a href="#" ng-click="submit()">Submit</a>

我的控制器代码是这样的

$scope.submit = function(){
    $state.go('app.calendar');
}

此代码将带我进入日历页。但在那之后,页面应该重新加载。有人能帮我吗

使用此::

$scope.submit = function(){
  $location.path('/calendar'); //need to add the path of calendar page
}

您正在寻找

$state.go('app.calendar', {}, {reload: true})