Skip to main content

Posts

Showing posts with the label Bootstrapping of Angular 9

Bootstrapping of Angular 9

Do put bootstrapping and platform logic for the app in a file named main.ts. Do include error handling in the bootstrapping logic. Avoid putting app logic in main.ts. Instead, consider placing it in a component or service. Example looks like - import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule }               from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule)   .then(success => console.log(`Bootstrap success`))   .catch(err => console.error(err));