Bootstrapping an Angular app
Every Angular app has, at least, one Angular module which is bootstrapped to launch the application. The module is also called as root module and it is placed in the root folder of the app. The root module is used to define all the modules and components which fit in together to build the app. The conventional name for this module is AppModule
. The following is a sample code for AppModule
, that is used to bootstrap the app with reactive forms.
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { ReactiveFormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { LoginComponent } from './rlogin/login.component'; @NgModule({ imports: [ BrowserModule, ReactiveFormsModule ], declarations: [ AppComponent, LoginComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }
Pay attention to some of the following...