填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

provideRoutes

Registers a DI provider for a set of routes.

provideRoutes(routes: Route[]): any
      
      provideRoutes(routes: Route[]): any
    
参数
routes Route[]

注册路由。

The route configuration to provide.

返回值

any

使用说明

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