Angular Introduction
Angular is a TypeScript framework from Google for building web applications that run in the browser. Instead of handing you a small library and leaving the architecture to you, Angular ships a complete toolbox: components, a template language, a router, forms, an HTTP client, dependency injection, a testing setup and a command-line tool that wires it all together.
Angular vs AngularJS
The name causes confusion, so let's clear it up first.
| AngularJS (1.x) | Angular (2+) | |
|---|---|---|
| Released | 2010 | 2016, new major version every ~6 months |
| Language | JavaScript | TypeScript |
| Building block | Controllers and $scope |
Components |
| Status | End of life since 2022 | Actively developed |
Everything in this course is about modern Angular — the current versions use standalone components, signals for reactive state and a built-in control flow syntax (@if, @for, @switch) directly in templates.
What does Angular code look like?
An Angular app is a tree of components. Each component is a TypeScript class plus an HTML template that describes what it shows. Here is a complete component:
import { Component, signal } from '@angular/core';
@Component({
selector: 'app-hello',
template: `
<h1>Hello, {{ name() }}!</h1>
<p>You have {{ unread() }} unread messages.</p>
`,
})
export class Hello {
name = signal('Mai');
unread = signal(3);
}Three things stand out:
- The
@Componentdecorator tells Angular this class is a component and gives it aselector(the custom HTML tag<app-hello>) and atemplate. {{ ... }}is interpolation — it inserts a value into the page.signal(...)creates a reactive value. When it changes, Angular updates exactly the parts of the page that read it.
Note: Angular itself cannot run inside this site's playground, so Angular examples show the code next to a preview of what the browser renders. Plain TypeScript examples (marked with a Run button) execute for real.
Why choose Angular?
| Strength | What it means for you |
|---|---|
| Batteries included | Router, forms, HTTP and testing are official packages that work together |
| TypeScript first | Type errors in your components and templates are caught at build time |
| Strong conventions | Large teams can read each other's code because projects look alike |
| Signals | Fine-grained reactivity without manual subscriptions |
| Long-term support | Predictable release schedule and automated ng update migrations |
Angular is popular for business applications, admin dashboards, banking and insurance portals, and any project where many developers maintain the same codebase for years.
TypeScript is the foundation
Angular code is TypeScript, so every class, interface and type annotation you already know applies. The examples below are pure TypeScript and run directly in your browser — a quick warm-up for the syntax you will see in every component:
interface Course {
title: string;
lessons: number;
free: boolean;
}
const course: Course = { title: 'Angular', lessons: 35, free: true };
function describe(c: Course): string {
const price = c.free ? 'free' : 'paid';
return `${c.title} has ${c.lessons} lessons and is ${price}.`;
}
console.log(describe(course));Angular has 35 lessons and is free.
Classes with typed fields are the shape of every Angular component and service:
class Counter {
count = 0;
increment(): void {
this.count++;
}
}
const counter = new Counter();
counter.increment();
counter.increment();
console.log(`Count is ${counter.count}`);Count is 2
What you will learn
- Angular Tutorial — components, templates, bindings, control flow, directives, pipes, signals, inputs/outputs and services.
- Building Apps — routing, forms, HTTP, RxJS, change detection, lazy loading and styling.
- Tooling — unit tests and production builds.
- Practice — exercises and a small task-board project.
Tip: You only need basic HTML, CSS and JavaScript to start. If TypeScript is new to you, the type annotations in this course are kept simple and explained when they appear.
Test yourself
Which language is modern Angular written in?
- Dart
- TypeScript
- CoffeeScript
- Plain ES5 JavaScript
What does {{ name() }} do in an Angular template?
- Declares a variable
- Calls a server function
- Inserts the value of the
namesignal into the page - Creates a comment
What is the building block of an Angular application?
- Controllers
- Components
- Scopes
- Widgets