I start with cordova with angular 1.5.6. Simple action:
$location.path("/someurl"); $window.location.reload();
works in Chrome and Android app, but not in ios app. What works on all platforms reboots after changing the location path.
This is achieved using the $ locationChangeSuccess event. This is the complete controller code so that everything is clear. The $ location.path is tagged, and $ window.location.reload () is placed in the $ locationChangeSuccess handler.
angular.module("demo").controller("LoginCtrl", function($scope, $http, $location, $window) { $scope.dologin = function() { $scope.message = ""; $http.post(app.baseurl + "/app/login", { email: $scope.email, password: $scope.password }, { withCredentials: true }).success(function(response){ $location.path("/dashboard"); // <--- }).error(function(response) { $scope.message = "invalid user/pass: "; }); } $scope.$on('$locationChangeSuccess', function() { $window.location.reload(true); // <--- });
});
source share