I'm struggling to find a way to do this. In the parent component, the template describes the element tableand its thead, but delegates the display to tbodyanother component, for example:
<table>
<thead>
<tr>
<th>Name</th>
<th>Time</th>
</tr>
</thead>
<tbody *ngFor="let entry of getEntries()">
<my-result [entry]="entry"></my-result>
</tbody>
</table>
Each myResult component displays its own tag tr, basically like this:
<tr>
<td>{{ entry.name }}</td>
<td>{{ entry.time }}</td>
</tr>
The reason I don't put this directly in the parent component (eliminating the need for the myResult component) is because the myResult component is actually more complex than shown here, so I want to put its behavior in a separate component and file.
DOM . , , tbody tr (. MDN), () DOM:
<table>
<thead>
<tr>
<th>Name</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<my-result>
<tr>
<td>Bob</td>
<td>128</td>
</tr>
</my-result>
</tbody>
<tbody>
<my-result>
<tr>
<td>Lisa</td>
<td>333</td>
</tr>
</my-result>
</tbody>
</table>
, , wrapping <my-result>, , ?
ng-content, DynamicComponentLoader, ViewContainerRef, , , , .