Adjust angular's to allow non reload path changes

This commit is contained in:
Johannes Zellner
2016-01-25 16:21:20 +01:00
parent 0a658e5862
commit 7a71315d33

View File

@@ -219,3 +219,17 @@ app.directive('laterName', function () { // (2)
}
};
});
app.run(['$route', '$rootScope', '$location', function ($route, $rootScope, $location) {
var original = $location.path;
$location.path = function (path, reload) {
if (reload === false) {
var lastRoute = $route.current;
var un = $rootScope.$on('$locationChangeSuccess', function () {
$route.current = lastRoute;
un();
});
}
return original.apply($location, [path]);
};
}]);