From c5ad38ee86d7f0737ea90cbf58ad8921c5cb15d0 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Tue, 13 Sep 2016 12:27:27 -0700 Subject: [PATCH] docs(ngmodule-faq): eager loaded Routed Feature Module must be imported (#2304) fixes #2298 --- public/docs/ts/latest/cookbook/ngmodule-faq.jade | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/docs/ts/latest/cookbook/ngmodule-faq.jade b/public/docs/ts/latest/cookbook/ngmodule-faq.jade index 3841bc3406..ce7a675018 100644 --- a/public/docs/ts/latest/cookbook/ngmodule-faq.jade +++ b/public/docs/ts/latest/cookbook/ngmodule-faq.jade @@ -781,14 +781,20 @@ table _Routed Feature Modules_ are _Domain Feature modules_ whose top components are the **targets of router navigation routes**. - All lazy loaded modules are routed feature modules by nature. + All lazy loaded modules are routed feature modules by definition. This chapter's `ContactModule`, `HeroModule` and `CrisisModule` are routed feature modules. Routed Feature Modules _should not export anything_. They don't have to because none of their components ever appear in the template of an external component. - Routed Feature Modules are _never imported_. + A lazy loaded Routed Feature Module should _not be imported_ by any module. + Doing so would trigger an eager load, defeating the purpose of lazy loading. + `HeroModule` and `CrisisModule` are lazy loaded. They aren't mentioned among the `AppModule` imports. + + But an eager loaded Routed Feature Module must be imported by another module + so that the compiler learns about its components. + `ContactModule` is eager loaded and, therefore, is listed among the `AppModule` imports. Routed Feature Modules rarely have _providers_ for reasons [explained earlier](#q-why-bad). When they do, the lifetime of the provided services