Question presented to candidate:
"Design the template of a reusable <app-dialog> with a title area, a body and a footer for buttons. Explain the difference between standard (single-slot) and multi-slot content projection, and how Angular decides which content goes where."
What a strong answer should cover:
- Single-slot: one
<ng-content />receives everything between the component's tags. - Multi-slot: several
<ng-content select="...">, each with a CSS-like selector (element,[attribute],.class, or a comma-separated list). - Content is placed in slot order, not source order; each node goes to the first matching slot, and the
select-less slot is the catch-all default. - Content that matches no slot when there is no default slot is silently dropped.
- Only top-level nodes are matched;
ngProjectAslets anng-container(or a wrapper) pretend to match a selector. A control flow block with a single root element projects into that element's slot. - Each slot can have its own fallback content (v18+).
Clarifying questions expected:
- "Should the title be required, or should the dialog show a default?"
- "Are footer actions always buttons, or could teams pass custom components?"
Code / implementation expected: Yes β a dialog or card with at least three slots.