
Learn how Angular's @defer block triggers lazy loading and explore the different loading strategies available to control when components are rendered for better performance and user experience.
Alain Chautard
June 2, 2026
We introduced the new @defer block to lazy-load components on the screen. We saw that @defer includes several config options to display errors, placeholder, and loading templates.
Today, let’s focus on the possible triggers for such lazy loading.
This is the default option. Will load the contents of that block once the browser is in an idle state:

Triggers the deferred block when its content enters the viewport. For instance, that would be when the user scrolls down, and the block becomes “visible.” Note that this option requires a placeholder (used to detect when the element comes into the viewport):

Another interesting option is to load the deferred block when another specified element makes it into the viewport using a template reference variable. That option does not require a placeholder:

Waits for the user to interact with the placeholder to load the deferred block. Even better, this trigger can be combined with another element so you can lazy-load a component on a button click, for instance:

The above code can be tested on Stackblitz here.
Similar to the two previous examples. Waits for the user to hover over the placeholder or a specified element:

immediate triggers the deferred block immediately as soon as Angular has finished rendering. Timer waits for a specified delay:
You can see most of these different examples on Stackblitz here. There are a few more options for '''@defer''' that I’ll cover later to keep this newsletter short and readable. It’s incredible what such a small API can do!
Get the latest news and updates on developer certifications. Content is updated regularly, so please make sure to bookmark this page or sign up to get the latest content directly in your inbox.

Deploying Nuxt: Presets, Platforms, and Hybrid Rendering
How to deploy Nuxt to Vercel, Netlify, Cloudflare, and Node, with hybrid rendering via routeRules.
Reza Baar
Jun 3, 2026

Trigger options for @defer
Learn how Angular's @defer block triggers lazy loading and explore the different loading strategies available to control when components are rendered for better performance and user experience.
Alain Chautard
Jun 2, 2026

Middleware: What It Is, How It Chains, and When to Write Your Own
Middleware is one of Laravel’s most tested certification topics because it sits at the core of the request lifecycle. This article goes beyond basic syntax to explain how middleware works internally, how the pipeline pattern processes requests, what happens when $next is skipped, and why some middleware never executes. If you want to truly understand Laravel middleware rather than just use it, this is where to start.
Steve McDougall
May 28, 2026