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.
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
injectto access the DI, it seems sensible to me to expand the list to include therunGuardsAndResolvers.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.