1
if ($scope.IsFormValid) {
  return $http({
         url: '/User/UserLogin',
           method: 'POST',
          data: JSON.stringify($scope.User),
             headers: { 'content-type': 'application/json' }
       }).success(function (d) {

                        $location.path('/here'); //how to use redirection here after success

       })
       .error(function (data) {
         $scope.LoginErrorMessage = "There was a problem logging in: " ;
       });
}

2 Answers 2

1
$window.location.href = '/here.html';

You may need to also inject the $window into your controller.

Sign up to request clarification or add additional context in comments.

Comments

0

It can be achieved using any one of these.

$window.location.href = '/here.html'; (like mentioned above)

or

$location.path("your path");

or

$state.go("state name");

Remember that you will have to inject these Services in your controller.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.