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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router state is Mutable via ActivatedRouteSnapshot #27528
Comments
Ideally the fix would be to automatically return a deep copy of the queryParams object, so that you can't fall into this trap |
Thanks for the issue. I scheduled to take a deeper look into this shortly after the holidays. It appears there are a number of people having similar issues so I'll see what we can do to get a resolution in place for it. |
Is there any update on this issue? |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
I fell into this trap as well. It did work at some point as I didn't have this issue before I upgraded to Angular 16 (but was migrating from 14) |
@mebibou @stonetwig @troehling Please give this issue a 馃憤 if you want it fixed .. I opened this issue almost five years ago, it hasn't been worked on due to lack of votes :/ |
馃悶 bug report
Affected Package
@angular/router (probably)
Is this a regression?
No. It appears to have existed for a while. See #17609
Description
If you mutate existing properties on the queryParams object of an ActivatedRouteSnapshot without making a deep copy, it appears to mutate the router's internal state. Telling the router to navigate using the mutated queryParams object does not trigger a navigation event in this case.
馃敩 Minimal Reproduction
https://stackblitz.com/edit/github-powged?file=src%2Fapp%2Freproduction%2Freproduction.component.ts
The text was updated successfully, but these errors were encountered: