Configuration

You can configure the way that @daffodil/external-router works by providing configurations to the DaffExternalRouterModule.

Usage

An array of DaffTypeRoutePairs can be passed as the second argument to forRoot. They can also be provided through DI using the provideDaffRouteResolvableByType function.

@NgModule({
    imports: [
        DaffExternalRouterModule.forRoot({
            failedResolutionPath: 'your-custom-error-path',
        }, [
      {
        type: 'some-type',
        route: { redirectTo: '/' },
        insertionStrategy: (route: Route, routes: Routes) => [
          ...routes,
          route
        ]
      }
    ]),
    ],
})
class AppModule {}

Configuration options

Property Purpose Default Value
failedResolutionPath The path to redirect to when external route resolution fails. '/'

For more information, see DaffExternalRouterConfiguration.

Graycore, LLC © 2018 - 2024. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.