Video lecture
Watch on YouTube(opens in a new tab)Sub topic 1
What Angular Is and When to Choose It
Angular is a component-based framework for building web applications. Google maintains it, and you write it in TypeScript. This chapter explains what comes in the box, how that differs from a view-only library, and when Angular suits a project.
Prerequisites
This tutorial assumes you already know:
- HTML and CSS fundamentals
- Modern JavaScript, including ES modules, classes and arrow functions
- Basic TypeScript types and the syntax of decorators
- How to use a terminal and npm
- Node.js, installed as an active or maintenance LTS release
You do not need any earlier experience with Angular or another front-end framework.
A Framework, Not Only a View Layer
A view-only library such as React renders UI from state. Everything else is up to you. You pick a router, a data-fetching approach, a form library, a test runner and a build setup, and then you keep them compatible with each other.
Angular ships those pieces as one platform. They are versioned together and tested together:
| Concern | Angular's built-in answer |
|---|---|
| Rendering UI | Components with HTML templates |
| Reactive state | Signals (`signal`, `computed`, `effect`) |
| Sharing logic | Services and dependency injection |
| Navigation | `@angular/router` |
| Forms | Template-driven and reactive forms |
| HTTP | `HttpClient` |
| Build, serve, test | The Angular CLI (`ng`) |
In practice, two Angular projects usually look alike. A developer who joins your team already knows where routes, services and components live.
Angular Versus AngularJS
Some people confuse Angular with AngularJS, and this is a common mistake. AngularJS (version 1.x) is a separate, older JavaScript framework. Its long-term support ended in January 2022. "Angular" means version 2 and later, and it is a full rewrite. Tutorials or Stack Overflow answers that mention $scope, ng-controller or angular.module are about AngularJS and do not apply here.
Modern Angular has also changed a lot from its early versions. Components are standalone by default, so you no longer need NgModule. Templates use built-in blocks such as @if and @for. Signals are the main way to hold reactive state. This tutorial uses these current patterns.
When to Choose Angular
Angular is a good fit when:
- The application is large and will be maintained for years.
- Several teams work on it and need shared conventions.
- You want one supported upgrade path. The
ng updatecommand migrates code between major versions. - Strong typing and structure matter more to you than freedom to pick each tool.
Something lighter may suit you better when:
- You are adding a small widget to an existing page.
- The site is mostly static content.
- Your team wants to assemble its own stack piece by piece.
Common Misconceptions
- "Angular is only for enterprises." Angular scales down well. The CLI gives a small app a working build, tests and dev server in one command.
- "I must learn RxJS first." RxJS is still used, for example by
HttpClientand the router. Signals now cover most component state, so you can start without RxJS. - "Angular needs NgModules." NgModules were required in older versions. In current versions, standalone components are the default.
Exercise
A team is building a five-year internal dashboard with routing, many forms and three contributing squads. Another developer needs a single interactive chart on a marketing page. Which project is the stronger fit for Angular, and why?
Show answer
The dashboard. It is long-lived, has several teams, and needs routing and forms, so it benefits from Angular's built-in router, forms, dependency injection, shared conventions and ng update path. A single chart widget gets little from the full platform, and a lighter view library is usually simpler for it.
Exercise
You find a guide that uses $scope and angular.module('app', []). Does it apply to the Angular framework covered in this tutorial?
Show answer
No. Those APIs belong to AngularJS (1.x), a separate framework whose support ended in January 2022. Modern Angular uses TypeScript components, signals and dependency injection instead.