@defer

Template syntax that loads a block and its code only when needed.

What does @defer do?

@defer delays loading part of a template (and its code) until it is needed, for example until it scrolls into view. @placeholder shows while waiting.

@defer (on viewport) {
  <app-comments />
} @placeholder {
  <p>Comments load when you scroll here</p>
}

Level: Journeyman · More Angular terms at this level

Updated