AI Hints
Home›Angular Tutorial›What Angular Is, Where Angular Is Used and How Angular Works
Angular · Lesson 3 of 120

How Angular Works

From code to page.

⏱ 2 min read▶ Video at 2:27🎓 Free
Watch this lesson in the Angular courseWatch on YouTube ↗Full Angular course

Before we write code, let's see the big picture. How does Angular turn our code into a page in the browser?

  • The big picture
  • Our code
  • A page in the browser

From code to page

We write components, in TypeScript, and HTML templates. The Angular CLI compiles them into plain JavaScript. The browser loads one HTML page, and that JavaScript. Angular then draws our components inside the page. And when our data changes, Angular updates just the parts that changed.

  1. Write components (TypeScript + HTML)
  2. The CLI compiles to JavaScript
  3. The browser loads the page
  4. Angular draws the components
  5. Data changes → page updates

The building blocks

Components are the pieces you see. Signals hold data that can change. Services hold shared logic, like loading books. And the router shows a different component for each URL. We'll learn each of these, one at a time.

keyvalue
Componenta piece of UI
Signaldata that can change
Serviceshared logic and data
Routera page per URL

A single page app

An Angular app is a single page app. The browser loads one page, just once. After that, Angular swaps components in, and out, without reloading. That's why Angular apps feel fast, and smooth.

keyvalue
Loadsone HTML page, once
ThenAngular swaps components
No reloadsbetween pages
Feelsfast and smooth

Summary

We write components, the CLI compiles them, and Angular draws them in one page, updating only what changes. Next, what you need to get started.

Key takeaways
  • Components
  • The CLI compiles
  • One page app
Next up: What You Need — Node.js and the Angular CLI