docs: update inline lazy loading example to use the import syntax (#32260)

PR Close #32260
This commit is contained in:
Arne Hoek 2019-09-26 14:41:59 +02:00 committed by atscott
parent d5071651df
commit f438ae8a3a
1 changed files with 5 additions and 8 deletions

View File

@ -372,17 +372,14 @@ export type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParam
* into multiple bundles and loading them on demand. * into multiple bundles and loading them on demand.
* To use lazy loading, provide the `loadChildren` property instead of the `children` property. * To use lazy loading, provide the `loadChildren` property instead of the `children` property.
* *
* Given the following example route, the router uses the registered * Given the following example route, the router will lazy load
* `NgModuleFactoryLoader` to fetch an NgModule associated with 'team'. * the associated module on demand using the browser native import system.
* It then extracts the set of routes defined in that NgModule,
* and transparently adds those routes to the main configuration.
* *
* ``` * ```
* [{ * [{
* path: 'team/:id', * path: 'lazy',
* component: Team, * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
* loadChildren: 'team' * }];
* }]
* ``` * ```
* *
* @publicApi * @publicApi