Up until now, I've been used to looping through lists in my Angular apps using the ngFor
directive without utilizing the async
pipe. However, today I came across the async
pipe and decided to give it a try.
So here's an example of a component template where I implemented it:
<ng-container *ngIf="todos$ | async as todos">
<div *ngFor="let todo of todos">{{ todo.content }}</div>
</ng-container>
And in the sample component class:
this.todos$ = this.todoService.getAllTodos();
My current dilemma is figuring out how to perform add, edit, or delete operations on the todos$
observable.