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>

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.

Further reading

Problem with a question

Angular · Middle · question 42

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz