Full answer
Angular is a framework for building single-page web apps in TypeScript. The browser loads one HTML page, and Angular builds and updates the visible screen from components.
The start-up path is short. The file main.ts calls bootstrapApplication(App, appConfig). The first argument is the root component. It is placed wherever its selector (here app-root) appears in index.html. The second argument is an ApplicationConfig object. Its providers array holds app-wide settings such as the router, the HTTP client, and the change detection strategy.
Think of a school. The root component is the school building. Each class room is a component inside it. A service is a shared office, such as the exam office, that many rooms ask for help. Dependency injection is the system that hands each room the office it needs, so no room builds its own.
The main building blocks are:
- Components: a TypeScript class plus an HTML template, which together describe one piece of the screen.
- Services: plain classes that hold shared logic or data, such as calling an API.
- Routing: maps URLs to components.
- Dependency injection: creates services and gives them to whoever asks.
Before Angular 14 every app needed an AppModule (an NgModule) for this. Since Angular 17 the CLI generates standalone apps by default, and this is the modern approach. NgModules still exist in older code bases.
// file: main.ts
import { Component } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app.config';
@Component({
selector: 'app-root',
template: `<h1>{{ title }}</h1>`,
})
export class App {
title = 'Class 10 marks board';
}
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
// file: app.config.ts
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true })],
};Checked with Angular 20.3 and TypeScript 5.8 (type-checked with the Angular compiler in strict template mode). Place the `<app-root></app-root>` tag in index.html and run it with `ng serve`. The Angular 20 CLI names the generated root class `App` in `app.ts`, and older projects use `AppComponent` in `app.component.ts`. Both styles are valid.
Key points
- `bootstrapApplication(RootComponent, config)` is the modern entry point; `platformBrowserDynamic().bootstrapModule(AppModule)` is the legacy one.
- `ApplicationConfig.providers` holds app-wide providers such as `provideRouter` and `provideHttpClient`.
- Components render the UI, services hold shared logic, and the injector connects them.
- Standalone components are the default from Angular 19 onward, so no `AppModule` is needed.
Common mistakes
- Describing Angular as a library. It is a full framework with routing, forms, HTTP, and testing tools included.
- Saying every app needs an `AppModule`. That is true only for older NgModule-based projects.
- Forgetting that the selector in the root component must match a tag in `index.html`, otherwise nothing renders.
Follow-ups
- What does `provideZoneChangeDetection({ eventCoalescing: true })` change?
- Where would you register an HTTP interceptor in this structure?
- How is this different from bootstrapping with an NgModule?
Tips
- Name the entry call (`bootstrapApplication`) and the config object. Many candidates only say "main.ts starts the app".
- Mention that you know both the standalone and the NgModule start-up, and say which one new projects use.
- Draw a quick box diagram on the whiteboard: root component, child components, services on the side.
Evaluation rubric
- Names bootstrapApplication and ApplicationConfig.
- Explains the role of components, services, and DI in one or two sentences each.
- Knows NgModules are legacy but still seen in old projects.