Angular · Middle · Question 43 of 75
What does this @defer block do?
@defer (on viewport) {
<app-comments />
} @placeholder {
<p>Comments</p>
}- ✓Correct answer: Downloads and renders
app-commentsonly when the placeholder enters the viewport - 2Renders comments after a fixed delay
- 3Renders comments only on the server
Explanation
The deferred component's code goes into a separate chunk. Other triggers are on idle (default), on interaction, on hover, on timer(2s) and when condition; prefetch on ... downloads earlier.