here my issues i am display a table using the nested *ngFor loop and and the table data is displayed using the Object Key approach as per my requirement here my issue is i unable to apply delete option for this .
here is my template .html
<ng-container *ngFor="let key of Data">
<tr *ngFor="let item of List[key];let i = index;">
<td>{{key}}-{{i}}</td>
<td>{{item}}--{{i}}</td>
<td>
<button (click)="del(i)">delete</button>
</td>
</tr>
</ng-container>
and after clicking on delete i am following this approach
.ts
delete(i){
this.Data.splice(i, 1);
}
here my issue is if click on the delete the entire tables row are getting deleted instead of single row
here
DynamicData = {
"laptop": [
"dell",
"hp",
"lenovo",
"acer",
"asus"
],
"mobile": [
"lenovo",
"motorolla",
"apple",
"samsung"
]
}
this.List = DynamicData;
this.Data = Object.keys(this.List);

DataandList? - Explosion Pills