1. Features Module
2. Routing Module
3. Service Module
4. Widget Module
5. Shared Module
Features Module — The feature modules are NgModules for the purpose of organizing an application code.
Routing Module — The Routing is used to manage routes and also enables navigation from one view to another view as users perform application tasks.
FooModule
in foo.module.ts
has a routing module named FooRoutingModule
in foo-routing.module.ts
.If the companion module is the root AppModule
, the AppRoutingModule
adds router configuration to its imports with RouterModule.forRoot(routes)
. All other routing modules are children that import RouterModule.forChild(routes)
.Service Module — The modules that only contain services and providers. It provides utility services such as data access and messaging Ideally they consist entirely of providers and have no declarations.
Widget Module — The third party UI component libraries are widget modules. A widget module should consist entirely of declarations, most of them exported.
Shared Module — The shared module allows you to organize your application code. You can put your commonly used components, directives, and pipes into the one module and use whenever required to this module.