0

I am facing issue in angular js, right now we have two urls in our application, http://localhost/xyz?page=documents&view=grid&sortorder=desc&sortby=updatedate&limit=35&offset=0

and then we another url http://localhost/abc

When i move from the first url to the second url it carries the query params from the first url, this is how the second url looks like http://localhost/abc?page=documents&view=grid&sortorder=desc&sortby=updatedate&limit=35&offset=35

We don't the fetch url carrying the query params from the first page. I am new to angular js, I have came across few options like $location.search({}); $location.url($location.path())

But those didn't work at all.

2
  • What do you mean by "moving from the first URL to the second URL"? Commented Nov 26, 2015 at 10:29
  • :) Changing from one page to another page Commented Nov 26, 2015 at 10:31

4 Answers 4

0

I think i know what you mean, to remove parameters use

$location.url($location.path());

Hope it helps

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

2 Comments

We are using routeprovider in our application, where do I keep this line to have the result?
I have tried using your solution in routechangestart but that didn't work, can you let me know how to use your solution
0

Check this documentation for the location with angular

Comments

0

1.Save the query object $location.search()in some place (local storage or cookies), then in the target controller $.map(query,funcion(k,v){ $location.search(k,v});

2.Dynamically append to the end url2 + $location.path() in href attribute

Comments

0

$location.url changes path, search and hash.
So, $location.url('new_path') should work!

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.