I have problem with reading data from nested array. Previously, I asked how to read data from nested array to display them in a table (as a new row) on HTML page; now, I need display data from nested array directly.
The array's structure: array1[var1,var2,array2[var3,var4]]
So... there is my problem:
<tr><br>
<td ng-repeat="...">...</td><br>
<tr>
I want to read var3
datas from array2
"directly", to display them side by side in the table. I need something as this:
<tr>
<td ng-repeat="item in array1.array2">{{item.var3}}</td>
</tr>
It is possible?
If you already know the name of the nested array and you are sure it exists, < tr >< td ng-repeat="item in array1.array2">{{item}}< /td >< /tr >
can work perfectly.
If what you want is to flatten this array from array1[var1,var2,array2[var3,var4]]
to [var1, var2, var3, var4]
, lodash can do you a favor
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments