I am using a drop down list inside primeng turbo table. I have an array that consists of two arrays that form the options for the drop down menu. I want the first option to come in the first row and the second options to come in the second row of the table.I tried using ngFor
but I am getting two drop downs in all the rows of the table with both set of options.
Here is my ts code:
arr1.push({label: "id", value: "1"});
arr2.push({label: "id", value: "2"});
masterArr.push(arr1);
masterArr.push(arr2);
Here is my template:
<ng-template pTemplate="body" let-rowData let-expanded="expanded" let-columns="columns">
<td>{{rowData.name}}</td>
<td>{{rowData.rollNo}}</td>
<td>
<p-dropdown *ngFor="let s of masterArr,let i = index" [options]="masterArr[i]" ></p-dropdown>
</td>
</tr>
</ng-template>
StackBlitz: https://stackblitz.com/edit/p-table-primeng-v6-tq33vs