Support some of the triggers from @defer for the @if block #53452
Labels
area: core
Issues related to the framework runtime
core: control flow
Issues related to the built-in control flow (@if, @for, @switch)
Milestone
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Maybe not all defer triggers make sense for the if block, but some of them yes. For example the
on viewport
trigger, you could only render a component once it enters the viewport. That's perfect for a virtual scroller implementation.Proposed solution
Alternatives considered
If it's not possible to bring those triggers to the if block, at least we could add another section to defer just like
prefetch
to let you destroy the component.It could be:
destroy on exitViewport(container)
destroy on exit(container)
Or anything else that makes sense.
The text was updated successfully, but these errors were encountered: