Angular applications are modular, and NgModules is Angular's modularity mechanism. NgModules refer to the containers for a logical code piece dedicated to a specific workflow, application domain, or capabilities set. Service providers, components, and other code files whose scope is defined by the contained NgModule are available with them. They can import functionality from other NgModules and export functionality for usage by other NgModules.
Each Angular application contains at least one NgModule class, also known as the AppModule (root module) and saved in the app.module.ts file. You can launch your application by bootstrapping the root NgModule.
While a small application might only contain one NgModule, most apps have more. Because it can include child NgModules in a hierarchy of any depth, the root NgModule for an application is called that.
A class with the @NgModule attribute defines a NgModule (). The @NgModule() decorator makes use of a single metadata object. Its properties describe the module and then return the same. Here are the most important qualities: