W3cubDocs

/Angular 12

provideRoutes

function

Registers a DI provider for a set of routes.

provideRoutes(routes: Route[]): any

Parameters
routes Route[]

The route configuration to provide.

Returns

any

Usage notes

@NgModule({
  imports: [RouterModule.forChild(ROUTES)],
  providers: [provideRoutes(EXTRA_ROUTES)]
})
class MyNgModule {}

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/router/provideRoutes