What is Angular, and when should you use it?
Angular is a complete application framework for building single-page web applications. Not a view library with an ecosystem bolted on — routing, forms, HTTP, testing and the build system all ship together and are versioned together.
What a single-page application actually is
In a traditional web application every click is a round trip: the browser requests a URL, the server renders HTML, the page reloads, all JavaScript state is lost.
In a single-page application the browser downloads the application once. After that, clicks are handled in JavaScript: the framework swaps out part of the DOM, updates the URL through the History API, and fetches only data — JSON — from the server.
| Server-rendered (Thymeleaf, Rails) | Single-page (Angular) | |
|---|---|---|
| First load | Fast — HTML arrives ready | Slower — must download the app |
| Subsequent navigation | Full page reload | Instant — no round trip for markup |
| Server payload per click | Whole page | Just JSON |
| Offline / optimistic UI | Not really possible | Natural |
| SEO | Free | Needs SSR (chapter 12) |
| Complexity | One codebase | Two codebases, two deployments |
| Best for | Content sites, simple CRUD | Dashboards, tools people use all day |
If your application is mostly reading content, or is ten forms behind a login that nobody uses for more than five minutes, a server-rendered page will be simpler, faster to build, and faster to load. Reach for Angular when the interface is the product — rich interaction, live updates, complex forms, lots of client-side state.
What Angular gives you in the box
| Concern | Angular | Typical React equivalent |
|---|---|---|
| Components & rendering | Built in | React |
| Routing | @angular/router | React Router (third party) |
| HTTP | HttpClient | fetch / axios / TanStack Query |
| Forms & validation | Reactive Forms | React Hook Form / Formik |
| State | Signals | Redux / Zustand / Jotai |
| Build & dev server | Angular CLI | Vite / Next.js |
| Testing | TestBed + Karma | Jest + Testing Library |
| Upgrades | ng update with automated migrations | Coordinate each library yourself |
That table is the argument, in both directions. Angular decides for you, which means less freedom and far fewer decisions to relitigate every eighteen months. Two Angular codebases written by different teams look broadly the same; two React codebases frequently do not.
Angular vs React vs Vue, honestly
| Angular | React | Vue | |
|---|---|---|---|
| Type | Framework | Library | Progressive framework |
| Language | TypeScript, always | JS or TS | JS or TS |
| Learning curve | Steeper start, flat later | Gentle start, steep ecosystem | Gentlest |
| Opinions | Many — and consistent | Few | Some |
| Templates | HTML + syntax | JSX | HTML + syntax |
| Reactivity | Signals | Re-render + hooks | Signals (refs) |
| Bundle (hello world) | ~120 KB | ~45 KB + libraries | ~60 KB |
| Hiring pool | Large, enterprise-heavy | Largest | Smaller in the West |
| Sweet spot | Long-lived business apps, big teams | Anything, with decisions | Small to mid apps, fast delivery |
Ask how long the application will live and how many people will touch it. For a five-year internal platform maintained by rotating teams, Angular's uniformity is worth real money. For a marketing site or a two-month prototype, it is overhead. The Stack section argues this case in full.
The architecture
| Building block | Responsibility |
|---|---|
| Component | A piece of UI: a template, some state, and the logic that connects them. |
| Template | HTML plus Angular syntax — bindings and control flow. |
| Signal | A reactive value. Reading one inside a template creates a dependency. |
| Service | Logic and state that is not tied to one component — HTTP, shared state, business rules. |
| Dependency injection | Supplies services to whatever asks for them; the seam that makes testing easy. |
| Router | Maps URLs to components, guards access, and lazily loads code. |
| Directive | Behaviour attached to an element without a template of its own. |
| Pipe | A pure transformation used in templates — {{ total | currency }}. |
A first look at the code
import { Component, computed, inject, signal } from '@angular/core';
import { CurrencyPipe } from '@angular/common';
import { OrderService } from './order.service';
@Component({
selector: 'app-order-list',
standalone: true, // no NgModule needed
imports: [CurrencyPipe], // what this template uses
template: `
<input [value]="query()" (input)="query.set($any($event.target).value)"
placeholder="Filter by reference">
<p>{{ visible().length }} of {{ orders().length }} orders</p>
@if (loading()) {
<p>Loading…</p>
} @else {
<table>
@for (order of visible(); track order.id) {
<tr>
<td>{{ order.reference }}</td>
<td>{{ order.total | currency:'EUR' }}</td>
</tr>
} @empty {
<tr><td colspan="2">Nothing matches “{{ query() }}”.</td></tr>
}
</table>
}
`,
})
export class OrderListComponent {
private readonly service = inject(OrderService);
readonly orders = this.service.orders; // a signal
readonly loading = this.service.loading; // a signal
readonly query = signal('');
readonly visible = computed(() =>
this.orders().filter(o => o.reference.includes(this.query())));
}
Five things in that snippet define modern Angular:
standalone: trueThe component declares its own dependencies. No module registry to keep in sync.@if/@for/@emptyBuilt-in control flow. NoCommonModuleimport, better type narrowing, and an empty state without a second@if.trackis mandatoryThe compiler forces you to say how list items are identified, which removes a whole category of rendering bugs.inject()Works in field initialisers, so no constructor boilerplate.- Signals everywhereCalling
query.set(...)updates exactly the bindings that read it — nothing else is re-checked.
A short history (so old code makes sense)
| Version | Year | What changed |
|---|---|---|
| AngularJS 1.x | 2010 | A different framework entirely. $scope, two-way binding, no relation to modern Angular beyond the name. |
| Angular 2 | 2016 | Complete rewrite in TypeScript. Components, DI, RxJS. |
| Angular 9 | 2020 | Ivy renderer — smaller bundles, better errors. |
| Angular 14–15 | 2022 | Standalone components, typed forms, functional guards. |
| Angular 16–17 | 2023 | Signals, new control flow, @defer, new docs at angular.dev. |
| Angular 18–19 | 2024–25 | Zoneless change detection, signal inputs/outputs, httpResource. |
"Angular" and "AngularJS" are not the same product. If a Stack Overflow answer mentions
$scope or ng-controller, it is AngularJS and irrelevant to you.
Where Angular is genuinely weaker
- Initial bundle size. A trivial app is bigger than the React equivalent. Irrelevant for an internal tool, relevant for a public landing page.
- Learning curve. Dependency injection, RxJS and the template syntax are three distinct things to absorb before you are productive.
- Verbosity. More files and more ceremony than Vue or Svelte for the same screen.
- The docs churn. Because the framework moved fast recently, search results are full of superseded patterns.
Which statement about modern Angular is false?
Angular 2+ was a complete rewrite with no shared API surface. AngularJS concepts —
$scope, ng-controller, dirty-checking digest cycles — do not
exist in modern Angular.