@defer cho phép trì hoãn load/render một phần template và dependencies của nó theo trigger như viewport, interaction, hover, timer hoặc idle.
Ví dụ:
html
@defer (on viewport; prefetch on idle) {
<app-heavy-chart />
} @placeholder {
<app-chart-skeleton />
} @loading {
<p>Loading chart...</p>
} @error {
<p>Cannot load chart</p>
}Dùng cho UI chưa cần ngay để giảm initial bundle và cải thiện Core Web Vitals.