0

I'm trying to redirect the user using this line:

$location.path('/edit?a='+$scope.a+'&b='+$scope.b);

But, doing this, I just get a new url putted into the url bar of the browser without redirection and the url contains

localhost/dashboard/public/kol#/edit%3Fa=undefined&b=undefined

instead of

localhost/dashboard/public/edit%3Fa=undefined&b=undefined

How to deal with this please?

3
  • did you use ng-href or href ? Commented Jul 16, 2014 at 20:29
  • @ThomasP1988, I'm doing this from the controller. Because I need to get a scope value. Commented Jul 16, 2014 at 20:30
  • @user3818045 the docemnts for $location are what you need to read. They explain how to do both internal app redirects as well as outside of app Commented Jul 16, 2014 at 20:36

2 Answers 2

1

can you try it $window.location.href ? with injecting $window in your controller

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

2 Comments

thatt's not what you want ?
my bad...it might actually be. I am so used to thinking internal app redirect
0

You are trying to append search parameters to your URL. The right way to do this with angular from within js is $location.path('/edit').search({a : $scope.a, b : $scope.b})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.