-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Dynamically generated content is not projected #54872
Copy link
Copy link
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecompiler: template pipelinecore: content projectionregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous version
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecompiler: template pipelinecore: content projectionregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous version
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
It looks like that the new template pipeline which is enabled by default since version 17.3.0 does not properly handle projected contant which is created dynamically.
As you can see in the stackblitz example, if the element is statically added as a child of the container element, it is properly projected. However, if the content is dynamically created (e.g. with an
iforfor), then the container will be empty.It seems to be a rendering/DOM issue only, because the children are properly queried (see the console output).
Might be related: #54840
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-nnuszu?file=src%2Fmain.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version)Anything else?
The
ng versionis printed by the stackblitz example, we have the exact same versions except the OS which is not related in this case.