Tech Interview RoomStudy guides

Angular

What is Angular and what are its building blocks?

Beginner · 2 min read · Lesson 1 of 8 in Angular

Angular is Google's full TypeScript framework for building web applications. Unlike React and Vue, it ships an opinionated, integrated set of tools: the component model, dependency injection, router, forms, an HTTP client, testing utilities and the Angular CLI (ng new, ng generate, ng serve, ng build, ng test). It suits large teams that want one consistent architecture.

Building blocks

  • Components: a TypeScript class with the @Component decorator, an HTML template and styles (encapsulated by default). Since Angular 19, components are standalone by default: they import what they use directly, without NgModules.
  • Templates: HTML with bindings: interpolation {{ }}, property binding [src], event binding (click), two-way binding [(ngModel)], and built-in control flow @if, @for (with a required track), @switch, @defer.
  • Services and dependency injection: classes marked @Injectable({ providedIn: 'root' }), injected with inject() or constructor parameters.
  • Signals: reactive values (signal, computed, effect) that tell Angular exactly what to update.
  • Directives (change behaviour or appearance of elements) and pipes (format values in templates: date, currency, async).
  • Router, Forms (template-driven, reactive, and new signal-based forms) and HttpClient, often used with RxJS observables.

Release rhythm

A major version roughly every six months with 18 months of support; ng update automates most migrations.

Example

ts
// greeting.component.ts: a standalone component with signals and control flow
import { Component, computed, signal } from '@angular/core';

@Component({
  selector: 'app-greeting',
  template: `
    <input [value]="name()" (input)="name.set($any($event.target).value)" placeholder="Your name" />
    <h2>{{ greeting() }}</h2>

    @if (tasks().length) {
      <ul>
        @for (task of tasks(); track task.id) {
          <li [class.done]="task.done" (click)="toggle(task.id)">{{ task.title }}</li>
        }
      </ul>
    } @else {
      <p>Nothing to do 🎉</p>
    }
  `,
  styles: [`.done { text-decoration: line-through; }`],
})
export class GreetingComponent {
  name = signal('Asha');
  greeting = computed(() => `Hello, ${this.name()}!`);
  tasks = signal([{ id: 1, title: 'Learn signals', done: false }]);

  toggle(id: number) {
    this.tasks.update(list => list.map(t => (t.id === id ? { ...t, done: !t.done } : t)));
  }
}

Follow-up questions interviewers ask

Try answering each one before you open it.

How is Angular different from React?

React is a UI library: you pick routing, state, forms and data fetching libraries yourself, and write JSX. Angular is a framework with all of those built in, TypeScript-first, HTML templates compiled ahead of time, and dependency injection as a core concept. Angular trades flexibility for consistency across large codebases.