How do you optimize performance in Angular
pplications?
Common techniques:
- Use OnPush change detection.
- Implement trackBy in *ngFor.
- Use lazy loading for modules.
- Avoid heavy computations in templates.
- Use pure pipes for filtering/formatting.
- Use memoization to cache expensive function results.
- Detach change detector manually for rarely updated components.
- Use ngZone.runOutsideAngular() for non-Angular async operations.