Based on the following usage of the async pipe, and assuming the users class field is an Observable, how many subscriptions to the users Observable are being made?

<h2>Names</h2>
<div *ngFor=”let user of users | async”>{{ user.name }}</div>
<h2>Ages</h2>
<div *ngFor=”let user of users | async”>{{ user.age }}</div>
<h2>Genders</h2>
<div *ngFor=”let user of users | async”>{{ user.gender }}</div>
  •  None. The async pipe does not subscribe automatically. None.
  •  None. The template syntax is not correct.
  •  Three. There is one for each async pipe.
  •  One. The async pipe caches Observables by type internally.

Leave a Reply

Your email address will not be published. Required fields are marked *