A module in Angular refers to a place where you can group the components, directives, pipes, and services, which are related to the application.


Angular is modular and Angular provide NgModule modularity system. An NgModule is a container for a cohesive block of code. It can contain components, service providers, pipes, and directives.

ng modules structure

@NgModule metadata:

NgModule contains the following metadata.
2. providers
3. declarations
4. exports
5. bootstrap

The imports array can be used to import the functionality from other Angular modules.

ng modules import structure

This will include the services created.
Providers are used for dependency injection

ng module provider structure

It is an array of components created.

This is used to export components, directives, and pipes which can
then be used in other modules.

ng modules export structue

This includes the main app component for starting the execution.

ngModules bootstrap

Leave a Reply