I have a template that shows one thing if certain condition is true, and another thing if certain condition is false.
I have tried the ng-template, but it is not working:
<div *ngIf="conditionA$ | async; else elseBlock">A CAT</div>
<ng-template #elseBlock>
<div *ngIf="conditionB$ | async">A DOG</div>
</ng-template>
I would like to setup a function that will set an "or" for two observables:
TS
public conditionA$ = this.billingService.conditionAA$;
public conditionB$ = this.billingService.conditionBB$;
get combined$() {
return combineLatest(
this.conditionA$,
this.conditionB$,
(A, B) => (A || !(B)));
}
HTML
<div *ngIf="combined$ | async">something<div/>
this code gives me an error:
ERROR Error: InvalidPipeArgument: 'function (source) { return source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source].concat(observables)), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__"CombineLatestOperator"); }' for pipe 'AsyncPipe' at invalidPipeArgumentError