feat(product-selection): add loading state during product fetch

This commit is contained in:
2025-05-06 08:33:46 +02:00
parent 1c46e15836
commit 03bb5e70ee
5 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,8 @@
<select [ngModel]="selectedProduct()" (ngModelChange)="onProductChange($event)">
<option [ngValue]="null">Select a product</option>
<option *ngFor="let product of products()" [ngValue]="product">{{ product.title }} - {{ product.price | currency : 'EUR' : 'symbol' : '1.2-2' }}</option>
<ng-container *ngIf="isProductLoading()">
<div>Loading...</div>
</ng-container>
<ng-container *ngIf="!isProductLoading()">
<select [ngModel]="selectedProduct()" (ngModelChange)="onProductChange($event)">
<option [ngValue]="null">Select a product</option>
<option *ngFor="let product of products()" [ngValue]="product">{{ product.title }} - {{ product.price | currency : 'EUR' : 'symbol' : '1.2-2' }}</option>
</select>