mirror of
https://github.com/Raghu-Ch/InventoryApp.git
synced 2026-02-10 04:43:02 -05:00
add safe check for product details
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
<section>
|
<section>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3>{{product.productName}}</h3>
|
<h3>{{product?.productName}}</h3>
|
||||||
<p>Brand: {{product.brand}}</p>
|
<p>ProductCode: {{product?.productCode}}</p>
|
||||||
<p>$ {{product.price}}</p>
|
<p>Brand: {{product?.brand}}</p>
|
||||||
<p>{{product.category}}</p>
|
<p>Price: ${{product?.price}}</p>
|
||||||
|
<p>{{product?.category}}</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class ProductDetailComponent implements OnInit {
|
|||||||
// console.log(id$);
|
// console.log(id$);
|
||||||
this.productService.getProduct(id).subscribe((res) => {
|
this.productService.getProduct(id).subscribe((res) => {
|
||||||
this.product = res;
|
this.product = res;
|
||||||
console.log(this.product);
|
// console.log(this.product);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export class ProductComponent implements OnInit {
|
|||||||
this.productService.getProducts().subscribe((res) => {
|
this.productService.getProducts().subscribe((res) => {
|
||||||
this.showSpinner = false;
|
this.showSpinner = false;
|
||||||
this.products = res;
|
this.products = res;
|
||||||
console.log(this.products);
|
// console.log(this.products);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user