I have a array of array like this
[[{"name":"PC Repairing @ 250","id":"1","checked":true},{"name":"PC Repairing @ 350","id":"2","checked":true}],[{"name":"PC Repairing @ 250","id":"3","checked":true},{"name":"PC Repairing @ 350","id":"2","checked":true},{"name":"PC Repairing @ 250","id":"1","checked":true}],[{"name":"PC Repairing @ 250","id":"3","checked":true},{"name":"PC Repairing @ 350","id":"2","checked":true},{"name":"PC Repairing @ 250","id":"1","checked":true}]]
how can i print this array using ngfor?
thanks in advance
Try to use for inside for
Example:
<ion-item *ngFor="let data of somedata">
<ion-item *ngFor="let insidedata of data">
Print here
</ion-item>
</ion-item>
1 Like
Thanks for your response. but here my problem is little bit different.Please could i tell you?
Yes Please , you can ask your concern here
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 could tell me how can i achieve this things am stuck around 7 day’s on this situation
above system1 syatme2 … is dynamic its generated text box based on drop down value
Can you share your html and TS code please.
this is my Listpage.ts
openServiceproblem(index) {
const modal = this.modalCtrl.create(ServiceproblemPage);
modal.onDidDismiss(data => {
this.user_selected_service_data=data;
});
modal.present();
}
.html
<ion-row *ngFor="let item of number_of_texbox; let i=index">
<ion-col col-3><p class="system-name-head-text"><strong>System {{i+1}}</strong> </p></ion-col>
<ion-col col-8>
<button ion-button (click)="openServiceproblem(i)" class="select-sys-btn-sec">Select System Problem <ion-icon name="arrow-dropdown"></ion-icon>
</button>
</ion-col>
<ion-col col-1 (click)="remove_system(i)" *ngIf="delete_is_visable">
<div class="delete-btn">
<ion-icon name="trash"></ion-icon>
</div>
</ion-col>
<ion-col col-12>
<ion-input type="text" value="" class="sys-descrip" placeholder="System Description"></ion-input>
</ion-col>
<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>
</ion-row>
modatlCheckbox.ts
close(){
this.viewCtrl.dismiss(this.selectedArray);
}
selectMember(data,i){
if(data.checked ==true){
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);
}
Please check