Bootstrap an Angular Application

Vaiz
5 min readOct 28, 2020
Photo by Braden Collum on Unsplash

Angular is today, with its 10 versions released since 2010, still a fixed point for the development of Web applications.
Thanks to its early release compared to direct competitors, its well-articulated documentation and popularity in 2020 that makes it second only to React, the future of the Google’s framework will surely have a long life.

However, developers very often set about building websites with Angular without ever going through the start.
For this reason today we will not focus on how to build an Angular application, but we will take a closer look at the framework’s bootstrapping phase.

File: main.ts

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

From Angular documentation, the main.ts file is

The entry point for you application. Compiles the application with the JIT compiler (or AOT compiler adding the flag “aot” for the build…

--

--

Vaiz

WebDev with mainly expertise in React,Angular.Dabbled with Alexa.When not coding, you can find me dancing some JustDance choreography 🕺 or writing articles ✏️