user2899644
user2899644

Reputation: 103

Handling redirections in angularJS using $location

I have a url in the form of url = localhost/abcd . my present location is localhost/ghi?p=1 How can I do a redirect to the using $location. $location.path(url) redirects me localhost/abcd?p=1. I want it to get redirected localhost/abcd

Upvotes: 0

Views: 20

Answers (1)

Shailendra Singh Deol
Shailendra Singh Deol

Reputation: 637

You should use this like-

$location.path('/abcd');

I hope this will help you.

Upvotes: 1

Related Questions