Angular 17 New Control Flow | Allow more than one node at root @if, @else, @for, etc #53677
Labels
area: core
Issues related to the framework runtime
core: content projection
feature: votes required
Feature request which is currently still in the voting phase
feature
Issue that requests a new feature
Milestone
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Allow multiple child nodes inside new control flow like bellow
without throwing bellow error
Node matches the "[header]" slot of the "BoxComponent" component, but will not be projected into the specific slot because the surrounding @if has more than one node at its root. To project the node in the right slot, you can:
This check can be disabled using the
extendedDiagnostics.checks.controlFlowPreventingContentProjection = "suppress" compiler option.Proposed solution
Make bellow snippet work
Alternatives considered
Since I am using projections I have to use multiple @if
but this approach is a pain in the *ss, more verbose and less readable
The text was updated successfully, but these errors were encountered: