Angular · Junior · Question 23 of 75

What does the async pipe do?

@if (user$ | async; as user) {
  <p>{{ user.name }}</p>
}

Explanation

The async pipe manages the subscription for you, so there is no manual subscribe/unsubscribe and no memory leak. It also marks the component for check when a new value arrives.

Further reading

Problem with a question

Angular · Junior · question 23

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