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
{{ message }}
Repository navigation
Run runGuardsAndResolvers within injection context of the Route its part of #53944
Which @angular/* package(s) are relevant/related to the feature request?
router
Description
Would make implementation of non-trivial strategies simpler. Example of non-trivial strategy is one that would return true when current navigation contains specific "state" state, see #31843 (comment), this would be step forward to making on-demand resolver resolution less hackish. Right now it only receives from/to route snapshots as args which may not be sufficient for some use cases. Especially considering that routeConfig already contains many properties which accept functions such as guards or resolvers that do run within injection context which lets one use inject to access the DI, it seems sensible to me to expand the list to include the runGuardsAndResolvers.
Would be willing to give my shot at the implementation.
Proposed solution
Run runGuardsAndResolvers within injection context of the routeConfig its part of.
Alternatives considered
Manage route specific references to injectors manually via APP_INITIALIZER or ENVIRONMENT_INITIALIZER.
Reacted by Andrew Scott, Miroslav Foltýn, Filip Voska, Darko Raguž, Mihael Šafarić, Josip Januš, Ivana Leto, Philipp Burgmer, Tomek Ustowski, Char2s茶兔司 (Charles) and 5 more
changed the title [-]Run runGuardsAndResolvers within injection context of the routeConfig its part of[/-][+]Run runGuardsAndResolvers within injection context of the RouteConfig its part of[/+]on Jan 16, 2024
changed the title [-]Run runGuardsAndResolvers within injection context of the RouteConfig its part of[/-][+]Run runGuardsAndResolvers within injection context of the Route its part of[/+]on Jan 16, 2024
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
Activity
[-]Run runGuardsAndResolvers within injection context of the routeConfig its part of[/-][+]Run runGuardsAndResolvers within injection context of the RouteConfig its part of[/+][-]Run runGuardsAndResolvers within injection context of the RouteConfig its part of[/-][+]Run runGuardsAndResolvers within injection context of the Route its part of[/+]angular-robot commentedon Jan 17, 2024
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
feat(router): Execute RunGuardsAndResolvers function in injection con…
feat(router): Execute RunGuardsAndResolvers function in injection con…
Erbenos commentedon Nov 12, 2025
Sorry, I must have got it confused with different PR. Thanks!
feat(router): Execute RunGuardsAndResolvers function in injection con…
angular-automatic-lock-bot commentedon Dec 21, 2025
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.