New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(router): Allow navigation without updating the URL #9608
Conversation
e74ae79
to
a934b64
Compare
@@ -88,8 +88,8 @@ export declare class Router { | |||
routerState: RouterState; | |||
url: string; | |||
createUrlTree(commands: any[], {relativeTo, queryParams, fragment}?: NavigationExtras): UrlTree; | |||
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>; | |||
navigateByUrl(url: string | UrlTree): Promise<boolean>; | |||
navigate(commands: any[], extras?: NavigationExtras, skipLocationChange?: boolean): Promise<boolean>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't skipLocationChange be a part of NavigationExtras ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion it shouldn't. NavigationExtras don't apply when using navigateByUrl
because your building the URL manually and I'd prefer its use be consistent.
this will not update a browser history, but still will emit events for this.activatedRoute.params, is it right? |
Correct |
a934b64
to
c0e2378
Compare
Rebased |
c0e2378
to
b7a6e36
Compare
Rebased again. Will you review @vsavkin? |
b7a6e36
to
e198b08
Compare
Why is this suspended? |
will this make it in rc.5? |
* ``` | ||
* | ||
* In opposite to `navigateByUrl`, `navigate` always takes a delta | ||
* that is applied to the current URL. | ||
*/ | ||
navigate(commands: any[], extras: NavigationExtras = {}): Promise<boolean> { | ||
return this.scheduleNavigation(this.createUrlTree(commands, extras), false); | ||
navigate(commands: any[], extras: NavigationExtras = {}, skipLocationChange: boolean = false): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add skipLocationChange to extras?
5d7f73c
to
f877c0f
Compare
Changes made @vsavkin |
f877c0f
to
9d65742
Compare
Rebased and merge conflicts fixed |
9d65742
to
f6fd63b
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
The router always updates the URL on navigation
What is the new behavior?
The router can navigate without pushing a URL location update
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
Closes #9579 #9949