在 Angular 中,在模板中我们可以通过这种方式执行多个异步管道,但我们会丢失输入信息。
有没有办法保留它?
<div *ngIf="{
dogs: dogs$ | async,
cats: cats$ | async
} as data">
<!-- data.dogs is of type any instead of Dog[], is it possible to type data ? as
data: {dogs: Dog[], cats: Cat[]} -->
</div>