Angular · Middle · Question 58 of 75

How do you render the same template fragment in several places of a component?

<ng-template #price let-value>{{ value | currency }}</ng-template>
<ng-container *ngTemplateOutlet="price; context: { $implicit: total }" />

Explanation

A template can also be passed as an input to a child, which lets the parent customize how items are rendered.

Further reading

Problem with a question

Angular · Middle · question 58

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