I have list of item and inside every item open a same checkbox list but when select the checkbox from system 1 list it should be show only for system 1. but its show for every list of item. How can i do that.
below i attach my UI
Please help me out.
.modal.ts
close(){
this.viewCtrl.dismiss(this.selectedArray);
}
selectMember(data,i){
//for(let i=0; i<this.add_system;i++){
if(data.checked ==true){
this.selectedArray.push(data)
console.log(i)
//this.selectedArray[0].push(data)
}
else{
let newArray = this.selectedArray.filter(function(el) {
return el.id !== data.id;// id set is the static object. it will check according database response
});
this.selectedArray = newArray;
//this.text_field =false;
}
console.log(this.selectedArray);
}
.list.ts
openServiceproblem(index) {
const modal = this.modalCtrl.create(ServiceproblemPage,{add_system:this.add_system});
modal.onDidDismiss(data => {
this.user_selected_service_data=data;
});
modal.present();
}
.html
<ion-col col-12><p class="repair-detailsa-all-con" *ngFor="let item of user_selected_service_data; let i=index" >{{item.name}}</p></ion-col>