AngularJS - $ route.reload () not working

I am trying to reload the page using $route.reload() :

 var App = angular.module("App", ["ngRoute"]); var idx = 0; App.controller("List", function ($scope, $route) { $scope.changeWallet = function (index) { idx = index; $route.reload(); console.log("success"); }; } 

"success" appears in the console, but nothing happens.
How can i fix this?

+7
javascript angularjs
source share
2 answers

If you want to reload the full page instead of updating the route, enter the $window service and click location.refresh

$window.location.reload();

+9
source share

$ window.location.reload () will basically refresh the page, for example when you press F5 to refresh.

What I need is to reload certain views on the page without refreshing the entire page.

+3
source share

All Articles