Complete the code to display the observable value using async pipe in the template.
<p>{{ dataObservable[1] }}</p>The async pipe subscribes to the observable and displays its latest value automatically.
Complete the code to assign the observable value to a template variable using async pipe.
<ng-container *ngIf="userObservable[1] as user"> <p>{{ user.name }}</p> </ng-container>
The async pipe allows assigning the emitted value to a template variable with as.
Fix the error in the template to correctly display the observable's emitted value.
<div>{{ messageObservable[1] }}</div>The async pipe is the correct way to unwrap observables in Angular templates. Using '.subscribe()' or '| subscribe' causes errors.
Fill both blanks to correctly use async pipe with ngIf and assign the value to a variable.
<div *ngIf="profileObservable[1][2]profile"> <p>{{ profile.email }}</p> </div>
Use | async to unwrap the observable and as to assign the value to a template variable.
Fill all three blanks to unwrap the observable, filter items with price greater than 20, and transform the price in the template.
<div *ngIf="itemsObservable[1] as items"> <ul> <ng-container *ngFor="let item of items"> <li *ngIf="item.price [2] 20"> {{ item.name }} - {{ item.price [3] 1.2 | number:'1.2-2' }} </li> </ng-container> </ul> </div>
Use | async to unwrap the observable, filter items with price greater than 20, and multiply price by 1.2 for display.