AngularJs: Reload page

1544 ワード

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