Angular 22 · Components and templates
Load part of a template lazily
Load a heavy component only when it scrolls into view.
@defer (on viewport) {
<app-chart />
} @placeholder {
<p>Chart will load here.</p>
}
Official Angular 22 documentation
More components and templates commands
- Write a standalone component
- Pass data in and out
- Show content conditionally
- Loop over items
- Handle an event
- Bind a property
All components and templates commands · Angular 22 cheatsheet