Skip to content

Make routing configuration extensible

Daniel Gerhardt requested to merge extension-routes into master

The routing configuration has been adjusted to allow the addition of routes through extension modules. A new ExtensionRouteProvider has been introduced which allows the definition of additional routes outside of the original routing modules. An ExtensionRouteProvider defines new routes for a single RouteMountPoint which is used determine to which original mounting module the routes are added.

Usage:

@NgModule({
  // ...
  providers: [
    {
      provide: ExtensionRouteProvider,
      useFactory: () => new ExtensionRouteProvider(
        RouteMountPoint.CREATOR, [
        {
          path: 'some/extension/path',
          component: SomeExtensionComponent
        }
      ]),
      multi: true
    }
  ]
})
export class SomeExtensionModule {
}

Closes: #719 (closed)

Edited by Daniel Gerhardt

Merge request reports