| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…flow error Update the diagnostic message for NG8011 to explicitly suggest using `ngProjectAs` on an `<ng-container>` when content inside a control flow block fails to project into a named slot. Also clarifies when to use option 1 (ngProjectAs, for single-slot targeting) vs option 2 (splitting blocks, for multi-slot scenarios). Fixes angular#59398
| Back | FazBrowse Home | New Git URL |
Fixes #59398
PR Checklist
PR Type
What is the current behavior?
The diagnostic error NG8011 (controlFlowPreventingContentProjection) suggests wrapping content in an <ng-container/> but does not mention ngProjectAs, which is the key attribute needed to make the workaround actually work for named slots.
Users following the existing suggestion have no way to know they need ngProjectAs="[selector]" to target a specific slot, leading to confusion (as reported in the issue).
Additionally, the message does not clarify when to use the wrapping approach vs. splitting into multiple blocks, which are solutions for different scenarios (single-slot vs. multi-slot targeting).
What is the new behavior?
Option 1 of the diagnostic now explicitly shows <ng-container ngProjectAs="[selector]"> with the actual slot selector interpolated, and explains this is the right approach when all nodes target the same slot.
Option 2 now clarifies it is needed when nodes target different slots.
Example
Before:
After: