Mastering Angular Components
上QQ阅读APP看书,第一时间看更新

Main application NgModule

Let's also take a look at the main NgModule generated by the Angular CLI. You can find it in the path src/app/app.module.ts:

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
bootstrap: [AppComponent],
providers: []
})
export class AppModule { }

If you've been following the section Angular NgModule, about NgModule within the first chapter of this book, there should not be any surprises when looking at our generated main application module.

Our application currently only consists of one component, the AppComponent, which we're declaring within our AppModule. We also specify that this component should be bootstrapped when this module is being bootstrapped.