New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback content throws with multiple components v18.x #55466
Labels
Milestone
Comments
AndrewKushnir
added
area: core
Issues related to the framework runtime
core: content projection
labels
Apr 22, 2024
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Apr 23, 2024
…llback content Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass. These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty. Fixes angular#55466.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Apr 23, 2024
…llback content Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass. These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty. Fixes angular#55466.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Apr 24, 2024
…llback content Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass. These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty. Fixes angular#55466.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Apr 24, 2024
…llback content Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass. These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty. Fixes angular#55466.
AndrewKushnir
pushed a commit
that referenced
this issue
Apr 25, 2024
…llback content (#55478) Currently fallback content for `ng-content` gets declared and rendered out in one go. This breaks down if multiple instances of the same component are used where one doesn't render the fallback content while the other one does, because the `TNode` for the content has to be created during the first creation pass. These changes resolve the issue by always _declaring_ the template, but only rendering it if the slot is empty. Fixes #55466. PR Close #55478
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
Adding multiple components that make use of fallback content throws an error.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
To reproduce:
parent component:
Error:
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
It seems like moving the children around fixes this issue:
parent component:
The text was updated successfully, but these errors were encountered: