constructor(public navCtrl: NavController,
public navParams: NavParams,
public apiserviceprovider: ApiServiceProvider,
public platform: Platform) {
platform.ready().then(()=>{
platform.registerBackButtonAction(()=>this.goBack());
});
this.session_id = localStorage.getItem(‘session_id_val’);
this.category = navParams.get(‘category_id’);
this.apiserviceprovider.loadproduct(this.category)
.then(data => {
this.productdetails = data;
});
this.qty = 1;
}
// increment product qty
incrementQty(item, data) {
console.log(this.qty+1);
this.qty += 1;
}
// decrement product qty
decrementQty(item, data) {
if(this.qty-1 < 1 ){
this.qty = 1
console.log(‘1->’+this.qty);
}else{
this.qty -= 1;
console.log(‘2->’+this.qty);
}
}
public goBack() {
this.navCtrl.setRoot(HomePage)
}
}
when am clicking increment all the products value is change at a time. what am missed out this code