We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c6d8ad commit db04cd6Copy full SHA for db04cd6
APM-Final/src/app/products/product-detail.component.ts
@@ -19,8 +19,11 @@ export class ProductDetailComponent implements OnInit {
19
}
20
21
ngOnInit() {
22
- const id = +this._route.snapshot.paramMap.get('id');
23
- this.getProduct(id);
+ const param = this._route.snapshot.paramMap.get('id');
+ if (param) {
24
+ const id = +param;
25
+ this.getProduct(id);
26
+ }
27
28
29
getProduct(id: number) {
0 commit comments