I have two functions defined as example. First one is
$scope.redir = function () {
$location.path('/abc');
};
and it redirects fine, but next snippet doesn't work for some reason
$scope.signup = function() {
var user = {...}
return $http.post('/auth/signup', user);
$location.path("/abc");
console.log($location.path());
};
It does post part very well, user is added to a db correctly, but redirect doesn't follow. I've tried using $rootScope as adviced in few questions, but result is the same - button with signup() assigned does http.post and stops at "pushed" state with no redirect following. Here's what I pass to Ctrl by the way
function($scope, $location, $http)
Well, functions tend to stop when they hit return
. ;)
Did you mean this?
$http.post(...).success(function () {
$location.path(...);
})