Skip to content

Dynamically generated content is not projected #54872

Closed

Description

@csisy-bt4w

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 if or for), 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)

Angular CLI: 17.3.0
Node: 18.18.0
Package Manager: npm 10.2.3
OS: linux x64

Angular: 17.3.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.0
@angular-devkit/build-angular   17.3.0
@angular-devkit/core            17.3.0
@angular-devkit/schematics      17.3.0
@schematics/angular             17.3.0
rxjs                            7.8.1
typescript                      5.4.2
zone.js                         0.14.4

Anything else?

The ng version is printed by the stackblitz example, we have the exact same versions except the OS which is not related in this case.

Activity

  1. added
    regression
    area: core
    on Mar 15, 2024
  2. modified the milestone: needsTriage on Mar 15, 2024
  3. self-assigned this
    on Mar 15, 2024
  4. added a commit that references this issue on Mar 15, 2024
    62ed0de
  5. added a commit that references this issue on Mar 15, 2024
    c078820
  6. added a commit that references this issue on Mar 15, 2024
    879bd80
  7. angular-automatic-lock-bot commented on Apr 15, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: corecompiler: template pipelinecore: content projectionregression

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions