0

I am using Angular 2. I have an URL:

http://localhost:3000/#/briefcases/35/proposals

This URL is fine. But now I want to pass additional info with this URL. I want to add SortOrder and SortBy.

How do I accomplish this? What I want is something like this:

http://localhost:3000/#/briefcases/35/proposals?SortBy=Property&SortBy=Desc

How can I do this using Router.Navigate?

1

1 Answer 1

1

You navigate to a route with query parameters using syntax something like this:

this.router.navigate(['/proposals'], 
   { 
    queryParams: { sortBy: 'property', sortOrder: 'Desc' }
   }
);

I have a more complete example here: https://github.com/DeborahK/Angular-Routing

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

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.