Using Angular 2 ngFor I'm creating a table.
My problem is that my data array
contains elements
such that each element should create 2 consecutive rows in the table (Using different fields, The second row is collapsible with more data)
<tbody>
<tr *ngFor="let element of data; let i = index">
<th>...<th>
...
<td>...<td>
</tr>
</tbody>
Problem is that tbody
doesn't allow any attribute beside <tr>
.
I'm looking for something like
<tbody>
<template *ngFor="let element of data; let i = index">
<tr>...</tr> //row 1
<tr>...</tr> //row 2
</template>
</tbody>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…