Skip to main content

What types of modules are there in Angular?

In Angular, modules are divided into several types:

Types of modules

  1. Root Module - the application's main module, usually called AppModule. It starts the entire application and specifies the component for bootstrap.
  2. Feature Modules - contain specific application functionality, for example UserModule or AdminModule. They let you split up the code and make maintenance easier.
  3. Routing Module - handles routing within the application. Often created as a separate module to manage RouterModule.
  4. Shared Modules - include components, directives, pipes, and services used across different parts of the application.
  5. Lazy Modules - loaded on demand rather than at application startup, to reduce the initial load size.
  6. Core Module - contains global services and singleton objects that must be available throughout the application, usually imported only once in the root module.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.