From 6e7a57f97a764534ef96679f6994bbe7dd9607dc Mon Sep 17 00:00:00 2001 From: Ajit Singh Date: Mon, 9 Mar 2020 17:03:50 +0530 Subject: [PATCH] docs: add note that sting based lazy loading is opt-in (#35956) after angular version 8 string based lazy loading is not activated by default it is an opt in behaviour in which you have to add the lazy loaded routes in the tsconfig file for compilation. Aded a note too that it will be removed in version 11. Fixes #35652 PR Close #35956 --- aio/content/guide/lazy-loading-ngmodules.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/aio/content/guide/lazy-loading-ngmodules.md b/aio/content/guide/lazy-loading-ngmodules.md index 479c0a5567..692974a09b 100644 --- a/aio/content/guide/lazy-loading-ngmodules.md +++ b/aio/content/guide/lazy-loading-ngmodules.md @@ -101,7 +101,16 @@ Instead, it adds the declared route, `customers` to the `routes` array declared Notice that the lazy-loading syntax uses `loadChildren` followed by a function that uses the browser's built-in `import('...')` syntax for dynamic imports. The import path is the relative path to the module. -#### Add another feature module +
+
String-based lazy loading
+ +In Angular version 8, the string syntax for the `loadChildren` route specification [was deprecated](https://angular.io/guide/deprecations#loadchildren-string-syntax) in favor of the `import()` syntax. However, you can opt into using string-based lazy loading (`loadChildren: './path/to/module#Module'`) by including the lazy-loaded routes in your `tsconfig` file, which includes the lazy-loaded files in the compilation. + +By default the CLI will generate projects which stricter file inclusions intended to be used with the `import()` syntax. + +
+ +### Add another feature module Use the same command to create a second lazy-loaded feature module with routing, along with its stub component.