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: " ;
       });
}
Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
Marylin
  • 11
  • 1

2 Answers2

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

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

es_
  • 66
  • 7
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.

Ritt
  • 3,181
  • 3
  • 22
  • 51