docs: fix lazy routes code snippet format (#34599)

PR Close #34599
This commit is contained in:
Alan Agius 2019-12-30 11:01:12 +01:00 committed by Alex Rickabaugh
parent ccb7bd0630
commit c2d03e5e21
1 changed files with 14 additions and 8 deletions

View File

@ -52,9 +52,11 @@ Instead, it adds the declared route, `customers` to the `routes` array declared
<code-example language="typescript" header="src/app/app-routing.module.ts">
const routes: Routes = [
{ path: 'customers',
loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule) }
];
{
path: 'customers',
loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule)
}
];
</code-example>
Notice that the lazy-loading syntax uses `loadChildren` followed by a function that uses the browser's built-in `import('...')` syntax for dynamic imports.
@ -73,11 +75,15 @@ The `orders` route, specified with the `--route` option, is added to the `routes
<code-example language="typescript" header="src/app/app-routing.module.ts">
const routes: Routes = [
{ path: 'customers',
loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule) },
{ path: 'orders',
loadChildren: () => import('./orders/orders.module').then(m => m.OrdersModule) }
];
{
path: 'customers',
loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule)
},
{
path: 'orders',
loadChildren: () => import('./orders/orders.module').then(m => m.OrdersModule)
}
];
</code-example>
## Set up the UI