You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
When using the ENVIRONMENT_INITIALIZER token in a lazy loaded component, the expected behaviour is that it should run the provider only when the path matches.
Right, so the current implementation creates the EnvironmentInjector as soon as the route attempts a match. There's no technical reason we can't wait until after a match is confirmed. I'll work on making this change today.
The reason ':id' injector is created even when just navigating to posts is that the children as still checked since they might contain an empty path.
Activity
atscott commentedon May 13, 2022
Right, so the current implementation creates the
EnvironmentInjectoras soon as the route attempts a match. There's no technical reason we can't wait until after a match is confirmed. I'll work on making this change today.The reason
':id'injector is created even when just navigating topostsis that the children as still checked since they might contain an emptypath.refactor(router): Only create the `Route` injector when the path matc…
ArielGueta commentedon May 14, 2022
Thanks for the quick fix.
angular-automatic-lock-bot commentedon Jun 14, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.