// app.component.html <div *ngIf="productSupplier$ | async as supplier"> {{ supplier.name }} </button> </div> // app.component.ts productSupplier$ = this.productService.productSupplier$; // product.service.ts selectedProduct$ = ... productSupplier$ = this.selectedProduct$.pipe( switchMap(product => this.http.get<Supplier>(`${url}/${product.supplierId}`)) );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter