Angular · Middle · Question 43 of 75

What does this @defer block do?

@defer (on viewport) {
  <app-comments />
} @placeholder {
  <p>Comments</p>
}

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.

Further reading

Problem with a question

Angular · Middle · question 43

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz