concept feature module in category angular

This is an excerpt from Manning's book Angular Development with Typescript, Second Edition.
An Angular app may consist of a root module and feature modules. You can implement a certain feature of your app (for example, shipping) in a feature module. Whereas the @NgModule() decorator of the root module of a web application must include the BrowserModule, feature modules include the CommonModule instead. Feature modules can be imported by other modules. The @NgModule() decorator of feature modules doesn’t include the bootstrap property, because bootstrapping the entire app is the responsibility of the root module.
The following listing generates a small app called Hello Modules and adds a feature module called ShippingModule to it.
Listing 2.4. Generating a project and a feature module
ng new hello-modules #1 cd hello-modules ng g m shipping #2This app will have a feature module with the following listing’s content in the file src/app/shipping/shipping.module.ts.
You know that providers can be defined on the component and module level, and that module-level providers can be used in the entire app. Things get complicated when your app has more than one module. Will the providers declared in the @NgModule of a feature module be available in the root module as well, or will they be hidden inside the feature module?
AM components are packaged as feature modules, and you should add only those modules that your app needs rather than adding the entire content of the AM library. You can either add the required modules to the root app module or create a separate module and list all required components there.