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();
};
上一篇:The preview is empty because of the setting.Check the generation option.


下一篇:iOS 开发:TCP三次握手连接