provideRoutes

注册路由。

Registers routes.

provideRoutes(routes: Route[]): any
      
      provideRoutes(routes: Route[]): any
    
参数
routes Route[]
返回值

any

使用说明

例子

Example

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