(click)="onProductSelect(item.id)" code example

Example: (click)="onProductSelect(item.id)"

Dynamic Page

1) (click)="onProductSelect(item.id)"  for html

2)  onProductSelect(id){
    this.nav.navigateForward('productlist/' + id);    for ts
    console.log('id of category',id);
  }

3). path: 'productlist/:id', for app routing


4)  this.id = this.activatedRoute.snapshot.paramMap.get('id');  dynamic page
 this.apiService.getItem(this.id).subscribe(response => {        ts ngoninit
      console.log('product response 1', response);
      this.products = response;
      console.log('product repsonse 2', this.products)
    })

Tags:

Misc Example