Repository navigation
Conversation
cda8788 to
e6eb02b
Compare
|
The angular.io preview for e6eb02b355837e428dc3e8d28cfca1ae570bcdc9 is available here. |
e6eb02b to
b2efc40
Compare
|
The angular.io preview for b2efc400de01101a8bb1d83a20fc901ad774114a is available here. |
b2efc40 to
222415a
Compare
|
The angular.io preview for 222415a2b2de9da80bf3e46ed1ec4cd096f314b9 is available here. |
There was a problem hiding this comment.
Not sure if targetLinkPartsis really useful. People will ask for the target URL which would be more useable.
|
LGTM - do we really want this in the router code ?
|
|
Using a custom Creating custom Not sure what you mean by "narrow use case". |
|
The angular.io preview for 1c3f06910418566eba8dcdaeec52c8f5c8a2ca07 is available here. |
1c3f069 to
48783fd
Compare
|
The angular.io preview for 48783fdb1357c45173e58afd75950fc40ceba2d5 is available here. |
48783fd to
392be5e
Compare
|
The angular.io preview for 392be5ecc3addc39eae7fa4857a32458ece7501a is available here. |
392be5e to
59e791e
Compare
|
The angular.io preview for 59e791eaa468cc54ba0eb2c92a624e1c5cb769d6 is available here. |
|
@vicb I updated this PR to expose the logic we use to deal with merging of query params. This way we aren't really adding code to the router, but allowing users to configure the way they deal with query params. I think this is a preferable way to address this issue. It allows users to get a hold of the default behavior and wrap it with their own behavior. It makes the use case from #16558 easily fixable, as well as future-proofs us for other requests to change this behavior. |
59e791e to
81cb1bc
Compare
|
The angular.io preview for 81cb1bc99338a3a271da5bc47e53289ce226fcfa is available here. |
There was a problem hiding this comment.
NavigationExtras does not have currentParams neither targetParams
There was a problem hiding this comment.
- Does it makes sense to pass the full
NavigationExtrashere ? - I still think that users will ask the current & next route once this PR is merged
There was a problem hiding this comment.
"Predicate" implies returns a boolean to me ? (I'm not a native speaker)
There was a problem hiding this comment.
queryParamsHandling = queryParamsHandling != null ? queryParamsHandling : this.queryParamsHandling;
and pass only the needed params to the predicate predicate(params, {queryParamsHandling, ...})
would make the code easier to follow
There was a problem hiding this comment.
I wanted to pass all the data to the strategy function (it should have been called strategy rather than predicate). This way we don't need to answer user's questions later about why we didn't pass something like the fragment or some such other property defined in NavigationExtras.
There was a problem hiding this comment.
const predicate = queryParamsHandlingPredicate || this.queryParamsHandlingPredicate;
|
@voithos by "narrow use case" I mean very specific to your app. If you configure a global merging, it will be used for all navigations/links regardless your origin and destination routes. It becomes easy to keep accumulating all parameters you ever encounter once. @jasonaden the current implementation seems reasonable to me (se my inline comments) - my only concern is still that users have no way to know source/target routes in the "predicate" and that's probably one thing they will ask next. |
9910403 to
3f6aea0
Compare
|
The angular.io preview for 1119cc6b252c07ec2b802715a9e806246da0fcd0 is available here. |
|
The angular.io preview for 9910403b9cec0d8cf02ccec04023ed3b85fef781 is available here. |
|
The angular.io preview for 3f6aea0c4e100ef6f96138bda86a4404f17e62a2 is available here. |
3f6aea0 to
4acb9a1
Compare
|
@voithos Based on discussions with the team, we aren't going to merge this one. Basically, this new API only provides a piece of what will likely be wanted by the community, and providing the extra data (current route, target route, etc) isn't possible at this time. Rather than publishing an API that only partially solves the problem, a workaround for your specific use case should be used. Options would include, but aren't limited to:
If there are more users interested in this type of functionality, we will revisit this and see if there's a way to provide a more full-featured API. |
Hello, Adding the What I'm looking for is a way to set queryParamsHandling globally. One idea would be to set queryParamsHandling as Attribute to the routes Array. Something like that: I already posted on stackoverflow: |
For us any way that enables to set |
|
This would be very useful for us too |
|
This would be useful for me, too |
|
as the app size grows, our use case for this grows as well |
We're also interested in this feature |
|
I need this option. fixing every routes or making own route directives is crazy, please revisit this issue @jasonaden |
We are having the same issue, using queryParamsHandling manually in every routerLink or in every router.navigate execution is really error prone. Being able to set the parameters globally in every route change would make a great feature. |
|
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. |
…dling
Closes #16558