Angular · Junior · Question 64 of 75

What is @let used for in a template?

@let total = price() * quantity();
<p>Total: {{ total }}</p>

Explanation

@let avoids repeating long expressions or several async pipes. The value is recalculated whenever the template is checked.

Further reading

Problem with a question

Angular · Junior · question 64

Test yourself

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

Take this quiz