Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
I want a sync access to router.snapshot.queryParams in CanMatch guard and it doesn't work:
{
path: 'todos',
canMatch: [() => {
// the location is todos?foo=1
console.log(inject(ActivatedRoute).snapshot.queryParams) // { }
return true;
}],
}
If I wrap it with a setTimeout it logs the correct value.
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)
No response
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
router
Is this a regression?
No
Description
I want a sync access to
router.snapshot.queryParamsinCanMatchguard and it doesn't work:If I wrap it with a
setTimeoutit logs the correct value.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)No response
Anything else?
No response