Skip to content

Commit

Permalink
docs: add note that sting based lazy loading is opt-in
Browse files Browse the repository at this point in the history
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 angular#35652
  • Loading branch information
ajitsinghkaler committed Apr 7, 2020
1 parent 416c786 commit 5f343e0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aio/content/guide/lazy-loading-ngmodules.md
Expand Up @@ -59,6 +59,18 @@ 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.

<div class="callout is-helpful">
<header>String based lazy loading</header>

You can also make your modules lazy loaded by string based lazy loading(loadChildren: './path/to/module#Module') without using the `import('...')` syntax but you have to include the lazy-loaded routes in your tsconfig file to make the lazy-loaded files a part of the compilation.

It is an opt-in this behaviour. As by default the CLI will generate projects which stricter file inclusions intended to be used with the `import()` lazy syntax.

Note: It is a deprecated syntax and will be removed in version 11 for details please refer [guide](guide/deprecations#loadChildren).

</div>


### Add another feature module

Use the same command to create a second lazy-loaded feature module with routing, along with its stub component.
Expand Down

0 comments on commit 5f343e0

Please sign in to comment.