Angular · Middle · Question 42 of 75
How do you create several named slots for projected content?
<!-- dialog.html -->
<header><ng-content select="[dialog-title]" /></header>
<main><ng-content /></main>- ✓Correct answer: With
selecton<ng-content>; content without a match goes to the default slot - 2With several components, one per slot
- 3Angular supports only one slot per component
Explanation
The selector can be an attribute, element or class. Note that projected content is always created by the parent, even when the slot is hidden by @if in the child.