Fix undefined error
This commit is contained in:
parent
c8913a71eb
commit
c48da30d1a
@ -1,3 +1,7 @@
|
||||
interface InventoryStatus {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
export interface Product {
|
||||
id?: string;
|
||||
code?: string;
|
||||
@ -5,7 +9,7 @@ export interface Product {
|
||||
description?: string;
|
||||
price?: number;
|
||||
quantity?: number;
|
||||
inventoryStatus?: any;
|
||||
inventoryStatus?: InventoryStatus;
|
||||
category?: string;
|
||||
image?: string;
|
||||
rating?: number;
|
||||
|
@ -98,7 +98,7 @@
|
||||
<label for="status">Inventory Status</label>
|
||||
<p-dropdown id="status" [options]="statuses" optionLabel="label" [(ngModel)]="product.inventoryStatus" placeholder="Select a Status">
|
||||
<ng-template pTemplate="selectedItem">
|
||||
<span *ngIf="product && product.inventoryStatus" [class]="'product-badge status-' + product.inventoryStatus.toLowerCase()">{{product.inventoryStatus}}</span>
|
||||
<span *ngIf="product && product.inventoryStatus" [class]="'product-badge status-' + product.inventoryStatus.value.toLowerCase()">{{product.inventoryStatus.value}}</span>
|
||||
</ng-template>
|
||||
<ng-template let-status pTemplate="status">
|
||||
<span [class]="'product-badge status-' + status.value.toLowerCase()">{{status.label}}</span>
|
||||
|
Loading…
Reference in New Issue
Block a user