This complete Angular tutorial covers 119 topics — from CLI and components to routing, RxJS, forms, signals, NgRx, Material, SSR, and a final Angular web application.
Course roadmap
- Introduction to Angular
- What is Angular?
- Features of Angular
- Angular vs React vs Vue
- Angular Architecture
- Angular CLI Installation
- Node.js and npm Setup for Angular
- Creating Your First Angular Project
- Angular Project Structure
- Angular CLI Commands
- TypeScript Basics for Angular
- Variables and Data Types in TypeScript
- Functions and Classes in TypeScript
- Interfaces and Types in TypeScript
- Angular Components
- Creating Components in Angular
- Angular Component Structure
- Component Lifecycle in Angular
- Angular Lifecycle Hooks
- Angular Templates
- Angular Template Syntax
- Interpolation in Angular
- Property Binding in Angular
- Event Binding in Angular
- Two-Way Data Binding in Angular
- Angular Directives
- Structural Directives in Angular
- Attribute Directives in Angular
- Custom Directives in Angular
- Pipes in Angular
- Built-in Pipes in Angular
- Custom Pipes in Angular
- Services in Angular
- Dependency Injection in Angular
- Creating Custom Services in Angular
- Angular Modules
- Standalone Components in Angular
- Angular Routing
- Route Configuration in Angular
- RouterLink in Angular
- Route Parameters in Angular
- Query Parameters in Angular
- Nested Routes in Angular
- Child Routes in Angular
- Lazy Loading in Angular
- Route Guards in Angular
- Authentication Guards in Angular
- HTTP Client in Angular
- HTTP GET Requests in Angular
- HTTP POST Requests in Angular
- HTTP PUT Requests in Angular
- HTTP DELETE Requests in Angular
- REST API Integration in Angular
- HTTP Interceptors in Angular
- Error Handling in Angular
- RxJS Introduction for Angular
- Observables in RxJS
- Subscribers in RxJS
- Subjects in RxJS
- BehaviorSubject in RxJS
- RxJS Operators in Angular
- map, filter and tap in RxJS
- switchMap in RxJS
- mergeMap in RxJS
- concatMap in RxJS
- catchError in RxJS
- debounceTime in RxJS
- Angular Forms
- Template-Driven Forms in Angular
- Reactive Forms in Angular
- Form Controls in Angular
- Form Groups in Angular
- Form Validation in Angular
- Custom Validators in Angular
- Dynamic Forms in Angular
- Form Submission in Angular
- Angular Signals
- Signal-Based State Management in Angular
- Computed Signals in Angular
- Effects in Angular Signals
- Angular State Management
- Services for State Management in Angular
- NgRx Introduction
- NgRx Store
- NgRx Actions and Reducers
- NgRx Effects
- Angular Material
- Angular CDK
- Responsive UI Development in Angular
- File Upload in Angular
- Image Upload in Angular
- Authentication and Authorization in Angular
- JWT Authentication in Angular
- Login and Registration in Angular
- Role-Based Access Control in Angular
- Local Storage and Session Storage in Angular
- Cookies in Angular
- Firebase with Angular
- Angular Animations
- Angular Testing
- Unit Testing with Jasmine in Angular
- Karma and Test Runners in Angular
- Component Testing in Angular
- End-to-End Testing in Angular
- Angular Performance Optimization
- Change Detection in Angular
- OnPush Change Detection in Angular
- Lazy Loading and Code Splitting in Angular
- Angular Security Best Practices
- SEO with Angular
- Angular SSR
- Angular Universal / Server-Side Rendering
- Angular Deployment
- Environment Configuration in Angular
- Git and GitHub with Angular
- Debugging Angular Applications
- Angular Interview Questions
- Real-World Angular Project
- Final Project – Complete Angular Web Application
1. Introduction to Angular
Angular is a TypeScript-based framework for building scalable web apps. This series covers CLI setup, components, templates, DI, routing, HTTP/RxJS, forms, signals, NgRx, Material, testing, SSR, and a complete final Angular application.
- Install Node and create an Angular app.
- Learn components, routing, and HTTP.
- Build the final Angular application.
Learning path
CLI + TypeScript + components
Templates, directives, pipes, DI
Routing + HTTP + RxJS
Forms + signals + state
Material, auth, testing, SSR
Final Angular web app
2. What is Angular?
Angular (by Google) is opinionated compared with library-first stacks like React.
Angular at a glance
TypeScript-first
Components + templates
Dependency injection
Router + HttpClient
CLI + schematics
Signals + RxJS
3. Features of Angular
Strong typing, AOT compilation, and first-party libraries speed up large apps.
Feature highlights
CLI scaffolding
AOT & tree-shaking
Reactive forms
HttpClient interceptors
Route guards & lazy loading
Angular Material / CDK
4. Angular vs React vs Vue
Angular is a full framework; React is a UI library; Vue is progressive with gentle defaults.
Quick compare
Angular → framework, TypeScript, DI
React → library, flexible ecosystem
Vue → progressive, approachable SFC
Pick by team skills & project scale
5. Angular Architecture
Data flows through templates, inputs/outputs, and injectable services.
Architecture layers
Components (UI)
Templates + binding
Services + DI
Router
HttpClient / state
Platform (browser/server)
6. Angular CLI Installation
Keep CLI version aligned with your project’s Angular major version.
- Install Node.js LTS.
- Install @angular/cli.
- Verify with ng version.
Install CLI
npm install -g @angular/cli
ng version
7. Node.js and npm Setup for Angular
Use an LTS Node version supported by your Angular release.
Verify
node -v
npm -v
8. Creating Your First Angular Project
Choose routing and stylesheet format during prompts (or pass flags).
- Run ng new.
- Install deps if needed.
- Serve and open the app.
Scaffold
ng new my-app
cd my-app
ng serve --open
9. Angular Project Structure
Keep feature folders scalable: pages, shared, core.
Typical structure
src/main.ts
src/app/
app.ts / app.config.ts
app.routes.ts
features/
shared/
public/
angular.json
10. Angular CLI Commands
Use ng build, ng test, and ng lint in day-to-day workflows.
Common commands
ng g c features/home
ng g s core/api
ng g g auth/auth
ng build
ng test
11. TypeScript Basics for Angular
Angular apps are TypeScript-first — weak typing slows you down later.
TS tip
let/const + types
interfaces & type aliases
classes & access modifiers
modules import/export
generics basics
12. Variables and Data Types in TypeScript
Prefer unknown over any for safer narrowing.
Types
let title: string = 'Home';
let count: number = 0;
let tags: string[] = ['angular'];
let id: string | number;
13. Functions and Classes in TypeScript
Angular components and services are classes (or functions in newer patterns).
Class sketch
class User {
constructor(public name: string) {}
greet(): string {
return 'Hello ' + this.name;
}
}
14. Interfaces and Types in TypeScript
Use interfaces for public APIs; unions/intersections with type.
Interface
interface Product {
id: number;
name: string;
price?: number;
}
15. Angular Components
Prefer small, focused components composed into pages.
Component idea
Selector
Template
Styles
Inputs / outputs
Lifecycle hooks
16. Creating Components in Angular
Standalone components import their own dependencies.
Generate
ng generate component features/product-card
# or: ng g c features/product-card
17. Angular Component Structure
Keep templates thin; move logic to services when shared.
Component sketch
@Component({
selector: 'app-hello',
standalone: true,
template: `<h1>{{ title }}</h1>`,
})
export class HelloComponent {
title = 'Hello Angular';
}
18. Component Lifecycle in Angular
Put setup in constructors carefully; prefer lifecycle hooks for DOM/async work.
Lifecycle idea
create → inputs set
change detection cycles
destroy → cleanup
hooks map to these phases
19. Angular Lifecycle Hooks
Unsubscribe / destroy refs in ngOnDestroy (or use DestroyRef).
Hooks tip
ngOnInit(): void { /* fetch / init */ }
ngOnChanges(changes: SimpleChanges): void { /* input changes */ }
ngOnDestroy(): void { /* cleanup */ }
20. Angular Templates
Templates compile with AOT — invalid bindings fail at build time.
Template tip
HTML + bindings
Directives & pipes
Control flow (@if/@for or *ngIf)
Event handlers
21. Angular Template Syntax
Prefer new control flow (@if, @for) on modern Angular versions.
Syntax map
{{ expr }} interpolation
[prop]="expr" property
(event)="handler()" event
[(ngModel)] two-way
@if / @for control flow
22. Interpolation in Angular
Keep expressions simple; heavy logic belongs in the class or pipes.
Interpolation
<h1>{{ title }}</h1>
<p>{{ user?.name }}</p>
23. Property Binding in Angular
Bind to DOM properties, not attributes, unless using attr.
Property binding
<img [src]="imageUrl" [alt]="title" />
<button [disabled]="isLoading">Save</button>
24. Event Binding in Angular
Pass $event when you need the native event object.
Event binding
<button (click)="save()">Save</button>
<input (input)="onType($event)" />
25. Two-Way Data Binding in Angular
FormsModule (or form directives) required for ngModel.
Two-way
<input [(ngModel)]="name" name="name" />
<p>Hello {{ name }}</p>
26. Angular Directives
Components are directives with templates; attribute directives change appearance/behavior.
Directive types
Components
Structural (*ngIf, @if, @for)
Attribute (ngClass, ngStyle, custom)
27. Structural Directives in Angular
Track @for items with a track expression for performance.
Control flow
@if (user) {
<p>{{ user.name }}</p>
} @else {
<p>Guest</p>
}
@for (item of items; track item.id) {
<li>{{ item.name }}</li>
}
28. Attribute Directives in Angular
Prefer classes for styling when possible.
ngClass
<div [ngClass]="{ active: isOn, disabled: !isOn }">Panel</div>
29. Custom Directives in Angular
Use directives for reusable DOM behavior without a full component.
Directive sketch
@Directive({ selector: '[appHighlight]', standalone: true })
export class HighlightDirective {
@HostBinding('style.backgroundColor') bg = '#ecfdf5';
}
30. Pipes in Angular
Pipes are for presentation — not for business mutations.
Pipe idea
{{ price | currency:'USD' }}
{{ createdAt | date:'medium' }}
31. Built-in Pipes in Angular
AsyncPipe subscribes to Observables/Promises and unsubscribes automatically.
Built-in tip
{{ users$ | async }}
{{ title | uppercase }}
{{ 0.25 | percent }}
32. Custom Pipes in Angular
Mark pure: false only when you must detect mutable input changes.
Custom pipe
@Pipe({ name: 'truncate', standalone: true })
export class TruncatePipe implements PipeTransform {
transform(value: string, limit = 20): string {
return value.length > limit ? value.slice(0, limit) + '…' : value;
}
}
33. Services in Angular
Keep components thin; put API and domain rules in services.
Service idea
@Injectable({ providedIn: 'root' })
API clients
State holders
Utilities with DI
34. Dependency Injection in Angular
providedIn: "root" creates app-wide singletons by default.
DI tip
constructor(private api: ApiService) {}
// or
private readonly api = inject(ApiService);
35. Creating Custom Services in Angular
Return Observables/Signals from services for components to consume.
Service sketch
@Injectable({ providedIn: 'root' })
export class ProductService {
private http = inject(HttpClient);
getAll() {
return this.http.get<Product[]>('/api/products');
}
}
36. Angular Modules
New apps often use standalone components — still know modules for legacy code.
NgModule tip
declarations / imports / exports
providers
bootstrap (root module)
Migrate gradually to standalone
37. Standalone Components in Angular
This is the modern Angular default path.
Standalone tip
@Component({
standalone: true,
imports: [RouterLink, CurrencyPipe],
templateUrl: './product.html',
})
export class ProductComponent {}
38. Angular Routing
Map URLs to components and nested layouts.
Routes sketch
export const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'about', component: AboutComponent },
{ path: '**', component: NotFoundComponent },
];
39. Route Configuration in Angular
Keep route config centralized as the app grows.
Config tip
path + component
redirectTo / pathMatch
loadChildren / loadComponent
data & title
canActivate guards
40. RouterLink in Angular
Prefer RouterLink over href for SPA navigation.
RouterLink
<a routerLink="/products" routerLinkActive="active">Products</a>
<a [routerLink]="['/products', product.id]">Details</a>
41. Route Parameters in Angular
Subscribe carefully or use snapshot when params won’t change in-place.
Params tip
// route: products/:id
this.route.paramMap.subscribe((p) => {
const id = p.get('id');
});
42. Query Parameters in Angular
Use queryParams / queryParamsHandling on navigate.
Query params
this.router.navigate(['/products'], {
queryParams: { page: 2 },
queryParamsHandling: 'merge',
});
43. Nested Routes in Angular
Parent component hosts child routes via a nested <router-outlet>.
Nested tip
Parent path + children[]
Parent template has router-outlet
Child paths relative to parent
44. Child Routes in Angular
Index routes fill the parent outlet by default.
Children sketch
{
path: 'admin',
component: AdminLayoutComponent,
children: [
{ path: '', component: AdminHomeComponent },
{ path: 'users', component: UsersComponent },
],
}
45. Lazy Loading in Angular
Cuts initial bundle size for large apps.
Lazy load
{
path: 'admin',
loadChildren: () =>
import('./admin/admin.routes').then((m) => m.ADMIN_ROUTES),
}
46. Route Guards in Angular
Functional guards are the modern style.
Guard tip
export const authGuard: CanActivateFn = () => {
const auth = inject(AuthService);
return auth.isLoggedIn() || inject(Router).createUrlTree(['/login']);
};
47. Authentication Guards in Angular
Combine with HTTP interceptors for API tokens.
Auth guard idea
Check session/token
Allow or redirect to /login
Store returnUrl query param
Role checks in separate guard
48. HTTP Client in Angular
Prefer typed responses and centralized error handling.
HttpClient tip
private http = inject(HttpClient);
this.http.get<Product[]>('/api/products');
49. HTTP GET Requests in Angular
Use AsyncPipe or explicit subscribe with teardown.
GET
this.http.get<Item[]>('/api/items', {
params: { q: 'angular' },
});
50. HTTP POST Requests in Angular
Set headers when the API expects custom content types.
POST
this.http.post<Item>('/api/items', { name: 'Notebook' });
51. HTTP PUT Requests in Angular
Idempotent updates belong on PUT/PATCH by API design.
PUT
this.http.put<Item>(`/api/items/${id}`, item);
52. HTTP DELETE Requests in Angular
Handle 204 empty responses without assuming a JSON body.
DELETE
this.http.delete(`/api/items/${id}`);
53. REST API Integration in Angular
Keep DTO types aligned with backend contracts.
REST tip
One service per resource area
Typed DTOs
Central base URL via interceptor/env
Loading & error UX in UI
54. HTTP Interceptors in Angular
Functional interceptors are the modern HttpClient API.
Interceptor idea
export const authInterceptor: HttpInterceptorFn = (req, next) => {
const token = inject(AuthService).token;
const authReq = token
? req.clone({ setHeaders: { Authorization: `Bearer ${token}` } })
: req;
return next(authReq);
};
55. Error Handling in Angular
Normalize API errors into a shared Error model.
catchError tip
this.http.get('/api/items').pipe(
catchError((err) => {
console.error(err);
return of([]);
})
);
56. RxJS Introduction for Angular
Think push-based values over time instead of one-off promises only.
RxJS idea
Observables produce values
Observers subscribe
Operators transform streams
Subjects are multicast
57. Observables in RxJS
HttpClient Observables are cold and complete after one response.
Observable tip
const sub = this.api.getAll().subscribe({
next: (data) => (this.items = data),
error: (err) => (this.error = err),
});
// unsubscribe in destroy / use async pipe / takeUntilDestroyed
58. Subscribers in RxJS
Prefer async pipe or signals to reduce manual subscriptions.
Subscriber tip
next → values
error → failures
complete → stream finished
Always plan teardown
59. Subjects in RxJS
Don’t expose raw Subjects publicly — expose asObservable().
Subject
private readonly refresh$ = new Subject<void>();
readonly refresh = this.refresh$.asObservable();
trigger() { this.refresh$.next(); }
60. BehaviorSubject in RxJS
Great for auth user and simple store-like services.
BehaviorSubject
private readonly user$ = new BehaviorSubject<User | null>(null);
readonly user = this.user$.asObservable();
setUser(u: User) { this.user$.next(u); }
61. RxJS Operators in Angular
Compose small operators instead of giant subscribe callbacks.
Operators tip
map / filter / tap
switchMap / mergeMap / concatMap
catchError / retry
debounceTime / distinctUntilChanged
takeUntilDestroyed
62. map, filter and tap in RxJS
tap is for logging/analytics — keep pure transforms in map.
map filter tap
this.http.get<User[]>('/api/users').pipe(
tap((users) => console.log(users.length)),
map((users) => users.map((u) => u.name)),
filter((names) => names.length > 0)
);
63. switchMap in RxJS
Ideal for typeahead search and route-param driven fetches.
switchMap tip
this.route.paramMap.pipe(
switchMap((p) => this.api.get(p.get('id')!))
);
64. mergeMap in RxJS
Use when parallel requests are intentional.
mergeMap tip
Concurrent inner subscriptions
Good for fan-out requests
Watch for request storms
65. concatMap in RxJS
Useful when order matters (sequential writes).
concatMap tip
Sequential inner subscriptions
Preserves order
Slower than mergeMap by design
66. catchError in RxJS
Re-throw with throwError when the UI must show failure.
catchError
pipe(
catchError((err) => {
this.notify.error('Load failed');
return of([]);
})
)
67. debounceTime in RxJS
Pair with distinctUntilChanged for efficient search.
debounceTime
this.searchControl.valueChanges.pipe(
debounceTime(300),
distinctUntilChanged(),
switchMap((q) => this.api.search(q || ''))
);
68. Angular Forms
Reactive forms scale better for complex validation and dynamic fields.
Forms overview
Template-driven → ngModel
Reactive → FormControl/FormGroup
Validators
Submit handlers
Error UX
69. Template-Driven Forms in Angular
Fine for simple forms; import FormsModule.
Template-driven
<form #f="ngForm" (ngSubmit)="save(f)">
<input name="email" ngModel required email />
<button [disabled]="f.invalid">Save</button>
</form>
70. Reactive Forms in Angular
Import ReactiveFormsModule / provide form directives as needed.
Reactive sketch
form = this.fb.group({
email: ['', [Validators.required, Validators.email]],
name: ['', Validators.required],
});
71. Form Controls in Angular
Read valueChanges for reactive UX.
FormControl
email = new FormControl('', {
nonNullable: true,
validators: [Validators.required, Validators.email],
});
72. Form Groups in Angular
Nest groups for address blocks and repeatable lines.
FormGroup tip
profile = new FormGroup({
name: new FormControl(''),
address: new FormGroup({
city: new FormControl(''),
}),
});
73. Form Validation in Angular
Disable submit while invalid or pending async validation.
Validation UX
@if (form.controls.email.touched && form.controls.email.hasError('email')) {
<p>Enter a valid email.</p>
}
74. Custom Validators in Angular
Reuse validators across FormControls.
Custom validator
export const bannedWord: ValidatorFn = (control) => {
const v = String(control.value || '');
return v.includes('test') ? { bannedWord: true } : null;
};
75. Dynamic Forms in Angular
Push/remove controls as the user adds rows.
FormArray tip
skills = this.fb.array<FormControl<string>>([]);
addSkill() { this.skills.push(this.fb.control('')); }
76. Form Submission in Angular
Mark all as touched to reveal errors on failed submit attempts.
Submit tip
onSubmit() {
if (this.form.invalid) {
this.form.markAllAsTouched();
return;
}
this.api.create(this.form.getRawValue()).subscribe();
}
77. Angular Signals
signal(), computed(), and effect() reduce boilerplate vs some RxJS patterns.
signal
count = signal(0);
inc() { this.count.update((c) => c + 1); }
78. Signal-Based State Management in Angular
Expose readonly signals to consumers.
Signal store tip
private readonly _items = signal<Item[]>([]);
readonly items = this._items.asReadonly();
setItems(items: Item[]) { this._items.set(items); }
79. Computed Signals in Angular
Keep computed pure — no side effects.
computed
total = computed(() =>
this.items().reduce((sum, i) => sum + i.price, 0)
);
80. Effects in Angular Signals
Use sparingly; prefer explicit calls for writes/API calls when clearer.
effect tip
effect(() => {
console.log('count', this.count());
});
81. Angular State Management
Start simple; introduce NgRx when many features share complex state.
State options
Component signals
Service + BehaviorSubject/signals
NgRx store
Server state: keep in HTTP + cache layer
82. Services for State Management in Angular
Clear pattern for medium apps without NgRx ceremony.
Service state tip
providedIn root
private writable state
public readonly selectors
methods to update
83. NgRx Introduction
NgRx shines in large enterprise Angular apps.
NgRx pieces
Store
Actions
Reducers
Selectors
Effects
84. NgRx Store
Select slices with selectors to minimize re-renders.
Store tip
provideStore / forRoot
feature stores
select typed state
immutable updates
85. NgRx Actions and Reducers
Keep reducers pure — no HTTP inside reducers.
Action tip
export const loadItems = createAction('[Items] Load');
export const loadItemsSuccess = createAction(
'[Items] Load Success',
props<{ items: Item[] }>()
);
86. NgRx Effects
Dispatch success/failure actions from effects.
Effects tip
listen to actions
call services
map to new actions
catchError → failure action
87. Angular Material
Add Material via ng add @angular/material.
Material tip
ng add @angular/material
88. Angular CDK
CDK powers Material and custom design systems.
CDK areas
a11y
overlay
drag-drop
portal
scrolling / table primitives
89. Responsive UI Development in Angular
Use CDK layout observables or CSS container queries as appropriate.
Responsive tip
Mobile-first CSS
Angular Material grid/layout
Breakpoints via CDK Layout
Fluid images & touch targets
90. File Upload in Angular
Show progress with HttpEventType.UploadProgress when needed.
FormData upload
const body = new FormData();
body.append('file', file);
this.http.post('/api/upload', body);
91. Image Upload in Angular
Revoke object URLs on destroy to avoid leaks.
Preview tip
previewUrl = URL.createObjectURL(file);
// later: URL.revokeObjectURL(previewUrl);
92. Authentication and Authorization in Angular
Split authentication (who you are) from authorization (what you can do).
Auth pieces
Login/register UI
Token/session storage strategy
Auth service + signals
Guards + interceptors
Role claims
93. JWT Authentication in Angular
Clear auth state on 401; refresh tokens carefully.
Bearer tip
req.clone({
setHeaders: { Authorization: `Bearer ${token}` },
});
94. Login and Registration in Angular
Disable double-submit; map server errors to fields.
Auth form tip
Reactive form validation
POST /login /register
Store token/session
Navigate to app home
Handle API errors
95. Role-Based Access Control in Angular
Always enforce authorization on the server too.
RBAC tip
roles on user profile
canActivate role guard
*ngIf / @if for buttons
server must re-check
96. Local Storage and Session Storage in Angular
Avoid storing secrets if XSS is possible; prefer httpOnly cookies for sessions.
Storage tip
localStorage.setItem('theme', 'dark');
sessionStorage.setItem('wizardStep', '2');
97. Cookies in Angular
Auth cookies should usually be HttpOnly + Secure + SameSite.
Cookie tip
HttpOnly for sessions
JS-readable only for non-sensitive prefs
CSRF strategy for cookie auth
Prefer backend-set cookies
98. Firebase with Angular
Lock down Firebase security rules — client code is not a security boundary.
Firebase tip
AngularFire
Auth state → signals/observables
Firestore streams
Storage uploads
Security rules required
99. Angular Animations
Respect prefers-reduced-motion for accessibility.
Animations tip
trigger / state / transition
query & stagger
route transition animations
reduced motion media query
100. Angular Testing
Prefer testing user-visible behavior over internals.
Test layers
Unit: services/pipes
Component: TestBed
E2E: Cypress/Playwright/Protractor legacy
101. Unit Testing with Jasmine in Angular
Karma traditionally runs Jasmine in Angular CLI projects (Jest also common).
Jasmine tip
describe('Math', () => {
it('adds', () => {
expect(1 + 2).toBe(3);
});
});
102. Karma and Test Runners in Angular
ng test launches the configured runner.
ng test
ng test
ng test --watch=false --browsers=ChromeHeadless
103. Component Testing in Angular
Override providers to mock services.
TestBed tip
await TestBed.configureTestingModule({
imports: [HelloComponent],
}).compileComponents();
const fixture = TestBed.createComponent(HelloComponent);
fixture.detectChanges();
104. End-to-End Testing in Angular
Keep e2e lean: login → core flow → logout.
E2E tip
Stable selectors
Seed data
Run against staging
Few high-value flows
105. Angular Performance Optimization
Profile first; use OnPush, lazy routes, and trackBy/@for track.
Perf checklist
OnPush + signals
Lazy routes
track in @for
Virtual scroll for long lists
Bundle budgets in angular.json
106. Change Detection in Angular
Async events trigger CD; avoid heavy work in templates.
CD tip
Default checks components
Zone.js patches async APIs
Signals integrate with CD
Keep templates light
107. OnPush Change Detection in Angular
Works great with immutable data and signals.
OnPush
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
// ...
})
export class ItemComponent {}
108. Lazy Loading and Code Splitting in Angular
Check budgets and source-map explorer for large chunks.
Split tip
loadComponent / loadChildren
Defer heavy Material modules
Analyze with build stats
Preload strategies optional
109. Angular Security Best Practices
Use HTTPS, CSRF strategies, and strict CSP where possible.
Security checklist
Avoid innerHTML with untrusted data
HttpOnly cookies preferred for sessions
Guards ≠ server authZ
Keep dependencies updated
Strict Content Security Policy
110. SEO with Angular
Client-only SPAs are weaker for crawlable content sites.
SEO tip
Title/Meta services
SSR/prerender for marketing pages
Fast LCP
Semantic HTML
111. Angular SSR
Watch for browser-only APIs during SSR (window/document).
SSR tip
Server render HTML
Hydrate on client
Guard browser APIs
Transfer state to avoid double fetch
112. Angular Universal / Server-Side Rendering
ng add @angular/ssr (modern) replaces older Universal setup flows.
Add SSR
ng add @angular/ssr
113. Angular Deployment
Configure SPA fallback routes for client routing on static hosts.
Deploy tip
ng build --configuration production
# deploy dist/ browser output (and server for SSR)
114. Environment Configuration in Angular
Never put secrets in frontend environment files.
Env tip
// environment.ts
export const environment = {
production: false,
apiUrl: 'http://localhost:3000/api',
};
115. Git and GitHub with Angular
Use PR checks: build + test.
Git tip
.gitignore node_modules dist .angular
Branch per feature
CI: ng test + ng build
Don't commit secrets
116. Debugging Angular Applications
Enable source maps in dev; profile CD when UI janks.
Debug toolkit
Angular DevTools
Browser Sources breakpoints
Network for HttpClient
Console errors
Router tracing (debug)
117. Angular Interview Questions
Be ready for DI, change detection, Observables vs signals, and forms.
Sample Q&A
Q: Component vs directive?
A: Components have templates; directives add behavior.
Q: Observable vs signal?
A: Streams over time vs synchronous reactive cells; both used in modern Angular.
Q: Why OnPush?
A: Skip CD when inputs are referentially equal.
118. Real-World Angular Project
Include routing, reactive forms, HTTP, and polished UI states.
Project ideas
Product catalog + cart
Admin CRUD dashboard
Issue tracker
Blog with SSR pages
Auth + profile settings
119. Final Project – Complete Angular Web Application
Ship a production-shaped app (e.g., task manager or recipe bookmarks): standalone Angular, routed features, auth + guards, HttpClient CRUD, reactive forms + validation, signals or service state, loading/error/empty states, optional Material UI, basic tests, environments, and deployment notes.
- Define routes and feature modules/folders.
- Implement auth + CRUD with forms.
- Polish states, guards, and interceptors.
- Test, document, and deploy the production build.
Final project scope
1. ng new standalone app + routing
2. Feature folders + lazy routes
3. Auth (login/register) + guards
4. CRUD feature with HttpClient
5. Reactive forms + validators
6. Signals or service state
7. Interceptor for auth/errors
8. Loading/error/empty UI
9. Unit tests for service/component
10. README + production build/deploy notes
Suggested structure
src/app/core
src/app/shared
src/app/features/auth
src/app/features/items
src/environments
Conclusion
You now have a full Angular path: components and DI, routing and HTTP/RxJS, forms and signals, and production topics like performance, security, and SSR. Finish the final Angular web application to turn the lessons into a portfolio-ready SPA.