What types of modules are there in Angular?
In Angular, modules are divided into several types:
Types of modules
- Root Module - the application's main module, usually called
AppModule. It starts the entire application and specifies the component forbootstrap. - Feature Modules - contain specific application functionality, for example
UserModuleorAdminModule. They let you split up the code and make maintenance easier. - Routing Module - handles routing within the application. Often created as a separate module to manage
RouterModule. - Shared Modules - include components, directives, pipes, and services used across different parts of the application.
- Lazy Modules - loaded on demand rather than at application startup, to reduce the initial load size.
- 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 readyPremium
A concise answer to help you respond confidently on this topic during an interview.