This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

provideRoutes

Registers routes.

provideRoutes(routes: Routes): any
      
      provideRoutes(routes: Routes): any
    

Parameters

routes

Type: Routes.

Returns

any

Usage notes

Example

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