-
Notifications
You must be signed in to change notification settings - Fork 29k
NavigationExtras when returning URLTree from guard #27148
Copy link
Copy link
Closed
Labels
area: routerfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under considerationstate: has PR
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area: routerfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under considerationstate: has PR
🚀 feature request
Relevant Package
This feature request is for @angular/router
Description
In #26521 (Angular 7.1.0), a feature was introduced that allows returning a
URLTreefrom guards in order to initiate a redirect. However, this doesn't seem to allow usingNavigationExtrassuch asskipLocationChange.Since the change in #26521 wasn't just syntax sugar, but is relevant to have predictable behavior when dealing with multiple guards, it should be considered to somehow allow using these options when returning a
URLTreeas well.Describe the solution you'd like
I don't have a really good proposal at this moment apart from next to returning
URLTreealso returning some kind ofsuch that I could use
I guess the exact typing of the guard would have to be
Admittedly, the return type of this function is growing increasingly complex with this.
Describe alternatives you've considered
Possible options that I don't think would make good solutions would be
[URLTree, NavigationExtras](this just feels unclean)