You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
It is not possible to use content projection based on CSS selectors when the projected content is in a deferrable view.
But it works when using contentChildren with structural directives and ngTemplateOutlet.
I was expecting that both approaches work the same regarding deferrable views, and it would be really nice to use @defer in simple CSS selector based content projection as well.
Please provide a link to a minimal reproduction of the bug
I spent some time on this and I got it mostly working in this branch. It's not working fully yet, because accounting for the different projection locations during hydration will require a larger refactor. We've discussed this within the team and decided not to address the issue at the moment, but to wait and see if more users run into it. In the meantime, you can work around it by adding an <ng-container ngProjectAs="your-selector"> to control where it will be projected.
Activity
crisbeto commentedon Dec 5, 2024
I spent some time on this and I got it mostly working in this branch. It's not working fully yet, because accounting for the different projection locations during hydration will require a larger refactor. We've discussed this within the team and decided not to address the issue at the moment, but to wait and see if more users run into it. In the meantime, you can work around it by adding an
<ng-container ngProjectAs="your-selector">to control where it will be projected.levylion commentedon Dec 26, 2024
just encountered this issue..
@crisbeto tnx for the workaround!
twittwer commentedon Jan 27, 2025
I was not able to apply this workaround, can one of you maybe show the workaround in the reproduction stackblitz?
https://stackblitz.com/edit/stackblitz-starters-ty28hm?file=src%2Fmain.ts
@crisbeto Thx for your try to fix it, I hope it will get some attention in the future.
angular-automatic-lock-bot commentedon Nov 17, 2025
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.