An angular module is one of the basic building block of any angular applications like component. A modules consist of one or more components and it does not control any html view. Modules configure the injector and the compiler and help us to organize related things together. Angular modules are a great way to organize an angular application and extend it with various capabilities from external source or libraries. Modules allow us to manage our components to bring modularity to our applications. A module can be created using @NgModule() decorator and this decorator holds below property:-
This is the place where we declares components, directives, and pipes belong to the module followed by import.
It will imports other modules with the components, directives, and pipes in the current module.
It will exports the list of components, directives, and pipes visible to modules, so that other module can import.
It provides the List of dependency injection providers visible both to the contents of this module and to importers of this module that the other application components can use.
List of components not referenced in any reachable template, such as dynamically created from code.
List of all components to bootstrap when this module is bootstrapped.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [
AppComponent
]
})
export class AppModule { }