您的位置:首页 > Web前端 > AngularJS

AngularJs: Reload page

2015-07-14 09:44 567 查看
<a ng-click="reloadRoute()" class="navbar-brand" title="home"  data-translate>PORTAL_NAME</a>


$scope.reloadRoute = function() {
$route.reload();
}


$scope.reloadRoute = function() {
$window.location.reload();
}


Later edit (ui-router):

As mentioned by JamesEddyEdwards and Dunc in their answers, if you are using angular-ui/ui-router you can use the following method to reload the current state / route. Just inject
$state
instead of
$route
and then you have:

$scope.reloadRoute = function() {
$state.reload();
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: