8000 Hook into router config loading · Issue #31800 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content
Hook into router config loading #31800
Open
@Necroskillz

Description

@Necroskillz

🚀 feature request

Relevant Package

This feature request is for @angular/router

Description

Router.resetConfig allows you to basically post process router at application startup - e.g. replace static placeholders, translate urls, mass add route data etc.). However you don't get a chance to do this for lazy loaded components.

Describe the solution you'd like

Add some possibility to hook into the RouterConfigLoader when routes from the child modules are processed (e.g. a provider that would be called with the routes resolved from the just loaded module's injector - https://github.com/angular/angular/blob/master/packages/router/src/router_config_loader.ts#L43).

Describe alternatives you've considered

The way to get around this is implemented in localized-router: https://github.com/Greentube/localize-router/blob/master/src/localize-router-config-loader.ts. This is a hack in the first place and will not work with the new loadChildren syntax.

The solution which would support also the new syntax is here: https://github.com/gilsdav/ngx-translate-router/blob/master/projects/ngx-translate-router/src/lib/localized-router.ts which is an even bigger hack.

/cc @gilsdav @meeroslav Pls comment if you have any thoughts on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routercanonicalThis issue represents a canonical design issue in Angular.featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationfreq1: low

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0