javascript - AngularJS – $route.reload() not working -
i'm trying 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"
shown in console, nothing happens.
how can fix this?
if want reload complete page instead of route refresh inject $window
service , call location.refresh
$window.location.reload();
Comments
Post a Comment