AngularJs: Reload page

<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 $stateinstead of $route and then you have:

$scope.reloadRoute = function() {
    $state.reload();
};
posted @ 2016-05-10 10:03  susanws  阅读(412)  评论(0编辑  收藏  举报