如何比较两个值?
<span *ngIf="(event | async)?.date !== (event | async)?.endDate">
{{ (event | async)?.endDate }}
</span>
答案 0 :(得分:1)
您订阅了太多次,我会尝试这样重构:
<ng-container *ngIf="event | async as e">
<span *ngIf="e.date !== e.endDate">
{{ e.endDate }}
</span>
</ng-container>