I have dropdown filters that filter some data, I'd like to be able to set one of these dropdowns with a value from the URL. Is this possible?
Asked
Active
Viewed 59 times
1
-
Checkout the [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) API. – Get Off My Lawn Jul 18 '22 at 19:36
-
1`window.location.href` gives you the current URL. If you want url parameters you can use the `ActivatedRoute` service to do the parsing for you. – Chris Hamilton Jul 19 '22 at 01:02
1 Answers
0
Try to check this: How to retrieve the url in Angular
Than you can for sure use the url to compose the options in the dropdown based on your custom logics.

Davide Passafaro
- 40
- 6
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 20 '22 at 04:41
-