Last Updated: May 2, 2026
Advanced Angular patterns: standalone components, signals, deferrable views, control flow syntax, dependency injection hierarchy, and performance optimization.
Standalone Components
| Feature | Code |
|---|---|
| Standalone flag | @Component({ standalone: true }) |
| Bootstrap | bootstrapApplication(AppComponent) |
| Lazy loading | loadComponent: () => import('./comp') |
Signals (Angular 16+)
signal(initialValue)Writable signal —
const count = signal(0). Read: count().computed()Derived signal, lazy and memoized.
input() / model()Signal-based component inputs.
Deferrable Views (@defer)
| Trigger | Purpose |
|---|---|
on viewport | Load when visible |
on idle | Load when browser idle |
on interaction | Load on click, focus, hover |
@placeholder | Skeleton UI before load |
Control Flow (v17+)
@if / @elseReplaces
*ngIf.@for / trackReplaces
*ngFor — track mandatory.Pro Tip: Use @defer (on viewport) for below-fold content — cuts initial bundle by 30-50%.