Home > Article > Web Front-end > Detailed explanation of NgModule (module) in Angular
This article will take you to learn more about NgModule (module) in Angular. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Related tutorial recommendations: "angular tutorial"
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import {HttpClient, HttpClientModule} from '@angular/common/http'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent, ], imports: [ BrowserModule, FormsModule, HttpClientModule, ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
declarations
#Declaring something in a module can only declare components, instructions and pipes.
imports
The import table declares some modules that the application depends on to run.
providers
Declares which services are provided in the module, only services can be declared.
bootstrap
Declares what the main component of the module is. Only the root module should set this bootstrap attribute.
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of Detailed explanation of NgModule (module) in Angular. For more information, please follow other related articles on the PHP Chinese website!