I would like to call a function received from a stream of data using Angular 9 async pipe.
The following code (onApprove)="(modalData$ | async).onApprove()"
throws this error: Cannot have a pipe in an action expression
I couldn't find a solution online, only references to questions about ngModel (example)
<div class="confirm-modal-container">
<div class="title">{{(modalData$ | async).title}}</div>
<div class="body">{{(modalData$ | async).body}}</div>
<app-action-buttons (onApprove)="(modalData$ | async).onApprove()" (onCancel)="(modalData$ | async).onCancel()" [cancelText]="currentStep === 0 ? 'Cancel' : 'Previous'" [approveText]="control[currentStep].actionBtnText"></app-action-buttons>
</div>
The data stream comes from Redux store
@select((state: IAppState) => state.ui.modal.modalData) readonly modalData$: Observable<any>;