I'm new to using angular and I'm attempting to display values from an array within another array in a table format.
Here is my JSON array that I'd like to display in rows:
{
"data": {
"Influencer": [
{
"clickDetails": [
[
{
"clk_counter": "1",
"social_type": "14"
}
],
[
{
"clk_counter": "32",
"social_type": "1"
}
]
]
}
]
}
}
In my HTML code, I am passing the data.Influencer array to resultSet, but it's only displaying the first array from clickDetails because I've set data.clickDetails[0] in the *ngFor loop. The other array is within data.clickDetails[1] and I'm unsure how to show that as well.
<tbody *ngIf="resultSet.length>0 ">
<tr role="row" class="odd" *ngFor="let data of resultSet">
<td>
<span *ngFor="let clickd of data.clickDetails[0]">
<span *ngIf="clickd.social_type==1">
{{clickd.clk_counter}}
</span>
</span>
</td>
<td>
<span *ngFor="let clickd of data.clickDetails[0]">
<span *ngIf="clickd.social_type==2">
{{clickd.clk_counter}
</span>
</span>
</td>
</tr>
</tbody>
The resultSet contains objects from the data.Influencer array.
Any assistance would be greatly appreciated!