From c2d03e5e21ac16daf7d3a13737f425ccb6dbe7a5 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 30 Dec 2019 11:01:12 +0100 Subject: [PATCH] docs: fix lazy routes code snippet format (#34599) PR Close #34599 --- aio/content/guide/lazy-loading-ngmodules.md | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/aio/content/guide/lazy-loading-ngmodules.md b/aio/content/guide/lazy-loading-ngmodules.md index ad753d1396..c9dec96983 100644 --- a/aio/content/guide/lazy-loading-ngmodules.md +++ b/aio/content/guide/lazy-loading-ngmodules.md @@ -52,9 +52,11 @@ Instead, it adds the declared route, `customers` to the `routes` array declared 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) + } +]; 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 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) + } +]; ## Set up the UI