Angular @defer breaks when a deferred component is used as a GENERIC TYPE (not a value) of the viewChild #55991
Labels
area: compiler
Issues related to `ngc`, Angular's template compiler
area: core
Issues related to the framework runtime
bug
core: defer
Issues related to @defer blocks.
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
workaround2: non-obvious
Milestone
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
When using
viewChild
to query for a component wrapped with@defer
and using the deferred component class as a generic type of theviewChild
, egchild = viewChild<ChildComponent>('someTplVariable')
the@defer
behavior breaks and the deferred component bundle is not extracted as a lazy loaded bundle.Steps to reproduce (also available inline in the Stackblitz)
open the provided Stackblitz
open demo in separate tab (so it's easy to see network tab traffic without Stackblitz specific things)
after 3 seconds, no additional bundle will be loaded after 3 seconds (network tab)
remove the generic type from view child
save and refresh the opened tab
the child bundle will be loaded after 3 seconds (network tab)
Expected behavior
Using the deferred component class only as a generic type will work with
@defer
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/view-child-generic-arg-breaks-defer
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: