This repository contains a complete, structured learning path for Angular 21, aligned with the official Angular documentation.
Each folder represents a chapter with practical demos and real-world examples.
Core Angular concepts and quick-start materials.
- What is Angular
- Installation
- Essentials
src/app/Essentials
Modern reactivity system introduced in Angular 21.
- Signal basics
- Computed & Effects
- Signal-based forms
src/app/Signals
Building UI using standalone Angular components.
- Inputs & Outputs
- Change Detection
- Content Projection
src/app/Components
New Angular template syntax and control flow.
@if,@for,@switch- Template expression rules
- Performance-friendly rendering
src/app/Templates
Creating and using Angular directives.
- Structural Directives
- Attribute Directives
- Reusable directive patterns
src/app/Directives Part
Modern DI system in Angular 21.
inject()API- Provider scopes
- Tree-shakable providers
src/app/Dependency injection
Complete routing playground aligned with Angular documentation.
- Navigation
- Route Params & Query Params
- Guards & Resolvers
- Child Routes
src/app/Routing
All Angular form APIs demonstrated in one structured section.
- Signal Forms
- Reactive & Typed Forms
- Template-driven Forms
- Dynamic
FormArray
src/app/Forms
Complete CRUD and networking demos using HttpClient.
- GET / POST / PUT / DELETE
httpResourceAPI- Interceptors
- Apidog mock backend
src/app/Http
Performance-focused rendering demos aligned with Angular guides.
- https://angular.dev/guide/ssr
- https://angular.dev/guide/hydration
- https://angular.dev/guide/incremental-hydration
Demonstrate SSR basics, hydration, incremental hydration, and hybrid rendering patterns.
- Server-side rendering setup
- Client hydration using
provideClientHydration() - Event replay during hydration
- Incremental Hydration for partial page activation
@deferblocks for hybrid / lazy rendering
src/app/app.config.ts→ hydration providerssrc/main.ts/src/app/appStart.ts→ SSR-ready bootstrapsrc/app/Performance/*→ performance & hydration demos
provideClientHydration(
withEventReplay(),
withIncrementalHydration(),
);
## RxJS (Overview → Operators → HttpClient)
Aligned with: https://rxjs.dev/guide/overview
### Topics
- Creating Observables (manual / `of` / `from` / `interval`)
- Core operators (`map`, `filter`, `tap`, `take`, `finalize`)
- HttpClient operators:
- `switchMap` (search / cancel previous)
- `mergeMap` (parallel requests)
- `concatMap` (queue requests)
- `exhaustMap` (prevent double submit)
- Error handling (`catchError`, `retry`, `timeout`)
- Combining streams (`forkJoin`, `combineLatest`)
### Folder
`src/app/Rxjs`
---
## 11. Unit Testing (Vitest)
Angular 21 uses **Vitest** as the default unit testing framework for new CLI projects (fast Node runner with a DOM emulation like `jsdom`).
This section includes practical demos for testing **components, services, directives, pipes, forms, and routing**.
### Topics
- Component testing (DOM, events, `@Input` / `@Output`, Signals)
- Reactive Forms testing (validation + submit)
- Services testing (pure services + `HttpClientTesting`)
- Attribute directives testing
- Pipes testing (e.g., SafeUrlPipe)
- Routing & navigation testing (PUBLIC_ROUTES, redirects, navigation)
### Folder
`src/app/Unit Testing`
---
### Run Tests
#### Run all unit tests (watch mode) Jasmine & Karma
```bash
ng test```
#### Run all unit tests (watch mode) Vitest
```bash
npm run test:vitest:ui```
## 12. Internationalization (i18n)
Angular 21 supports both **static (build-time)** and **runtime** internationalization strategies.
This section demonstrates **both approaches**, aligned with real-world Angular applications.
---
### 1. Static Internationalization (XLF – Build-time)
Angular built-in i18n using **XLIFF (XLF)** files.
Each language is compiled into a **separate application build**.
### Topics
- Angular built-in i18n
- XLIFF (XLF) translation files
- Build-time localization
- Multiple locale builds (e.g. `en`, `ar`)
- RTL support for Arabic
- SEO-friendly pages
### Folder
`src/app/Internationalization`
### Build Localized Versions
```bash
ng serve --configuration=ar --port 4300 -o
ng serve --configuration=en --port 4200 -oRuntime language switching using JSON-based translations without rebuilding the application.
- Runtime language switching
- JSON translation files
- User language preference
- RTL / LTR handling at runtime
- Standalone-friendly configuration
npm i @ngneat/transloco
src/app/Runtime-Localization
public/i18n
├─ en.json
└─ ar.json
ng serve- XLF (Build-time) → Static, SEO-friendly, separate builds per language
- JSON (Runtime) → Dynamic, instant language switching without rebuild
This setup reflects best practices used in production Angular applications.
Angular 21 provides a modern, CSS-first animation model with helpers like
animate.enter and animate.leave, making animations simpler, faster, and more declarative.
This section contains practical demos that cover real-world animation use cases, not just syntax examples.
- Enter animations using
animate.enter - Leave animations using
animate.leave - CSS-only animations with reusable keyframes
- Binding-based animations (state driven)
- Using
@starting-stylefor smooth leave transitions - Handling animation callbacks and cleanup
- Staggered animations using
animation-delay - Route transition animations
- Best practices & common pitfalls
src/app/Animations
Angular 21 uses Angular CDK DragDrop to build drag & drop features without third-party libraries.
This section contains practical demos for real-world use cases (sortable lists, kanban boards, and advanced interactions).
- Single draggable elements
- Reorder list (sorting)
- Transfer items between lists (kanban)
- Drag handle (
cdkDragHandle) - Lock axis (
cdkDragLockAxis:x/y) - Drag delay (press & hold) (
cdkDragStartDelay) - Disable drag (
cdkDragDisabled) - Disable sorting (
cdkDropListSortingDisabled) - Custom drag preview (
cdkDragPreview) - Custom placeholder (
cdkDragPlaceholder) - Dragging inside scrollable containers
- State updates with Signals
src/app/DragAndDrop