Skip to content
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

ActivatedRoute in Directive: Snapshot.params are not getting updated #55393

Closed
spirosdi opened this issue Apr 18, 2024 · 3 comments
Closed

ActivatedRoute in Directive: Snapshot.params are not getting updated #55393

spirosdi opened this issue Apr 18, 2024 · 3 comments
Labels
area: router needs reproduction This issue needs a reproduction in order for the team to investigate further
Milestone

Comments

@spirosdi
Copy link

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

When injecting ActivatedRoute in a directive and trying to get the route params calling this.activatedRoute.snapshot.params, the params returned are not the ones of the current route, but the ones from the first route visited. The issue appeared after updating @angular/core and @angular/router from 17.2.2 to 17.3.1. In 17.2.2 it works as expected, the params returned are the ones of the current route.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.3.5
Node: 20.9.0
Package Manager: npm 10.1.0
OS: darwin x64

Angular: 17.3.5
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-moment-adapter, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.5
@angular-devkit/build-angular   17.3.5
@angular-devkit/core            17.3.5
@angular-devkit/schematics      17.3.5
@schematics/angular             17.3.5
rxjs                            7.5.7
typescript                      5.3.3
zone.js                         0.14.4

Anything else?

No response

@JoostK
Copy link
Member

JoostK commented Apr 18, 2024

Please include a runnable reproduction.

@JoostK JoostK added needs reproduction This issue needs a reproduction in order for the team to investigate further area: router labels Apr 18, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 18, 2024
@naveedahmed1
Copy link
Contributor

In my case it seems that the query string parameters are case sensitive now

this.queryStringSub = this._activatedRoute.queryParams.subscribe((data) => {
      console.log('Query String:', data);
      console.log('countryId:', data['countryId']);
      console.log('countryid:', data['countryid']);
});

Output:

Query String: { countryid: '162' }
countryId: undefined
countryid: 162

@atscott
Copy link
Contributor

atscott commented Apr 26, 2024

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem still exists in your application, please open a new issue and follow the instructions in the issue template.

@atscott atscott closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: router needs reproduction This issue needs a reproduction in order for the team to investigate further
Projects
None yet
Development

No branches or pull requests

4 participants