import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
@NgModule({
imports: [
BrowserModule,
HttpModule,
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule { }
Angular Module Root
The code first imports the BrowserModule and HttpModule. Then, it declares AppComponent and bootstrap it. Finally, it exports AppModule. AppComponent specifies the structure and behavior of the application, while the bootstrap attribute specifies how the AppComponent should be initialized. In this case, AppComponent is initialized by using the imports and declarations attributes.
Shortcut: angular.module.root
0 Comments
Add Comment
Log in to add a comment