Angular · Middle · Question 74 of 75

How do you pass a template from a parent to customize how a child renders each item?

<app-list [items]="users" [itemTemplate]="row" />
<ng-template #row let-user>{{ user.name }}</ng-template>

Explanation

<ng-content> projects content once; a template can be stamped out many times with a different context for each item.

Further reading

Problem with a question

Angular · Middle · question 74

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