8

I'm trying to reload 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" is shown in console, but nothing happens.
How can I fix this?

Prophet
  • 32,350
  • 22
  • 54
  • 79
supertrall
  • 115
  • 1
  • 1
  • 7

2 Answers2

10

If you want to reload the complete page instead of route refresh inject the $window service and call location.refresh

$window.location.reload();

Chandermani
  • 42,589
  • 12
  • 85
  • 88
3

The $window.location.reload() will basically refresh the page like when you're pressing F5 for refresh.

What I am after is reload the specific views in the page not refreshing the entire page.

Frank Marcelo
  • 91
  • 1
  • 2