feat: accept UrlTree in navigate and initialRoute - #603
Open
gabrielmethot wants to merge 1 commit into
Open
gabrielmethot wants to merge 1 commit into
gabrielmethot wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This pull request adds new signatures to
navigateandinitialRouteto allow passing instances of UrlTree. This makes query params easier to configure because Angular handles the serialization. It also lets us pass a route fragment, which wasn't supported with string paths.String paths work the same as before, but they behave differently from a
UrlTreebecause they go through the library's own parser, which doesn't decode values or handle fragments. This can be surprising, so I documented it in the JSDoc.It might be worth considering using Angular's parser as the default, because that's probably what most developers expect. The custom query params parser could then be deprecated. Since this would be a breaking change, it might fit better in a future major version. I'd love to hear your thoughts about this.
Thanks for taking the time to review this, and for your work on the library!