I want to make a TableRowsComponent in angular 2 that renders to a number of table rows.
I would like to use it in a template like this:
<table class>
<tbody>
<table-rows *ngFor="#item of list" [someInput]="item"></table-rows>
</tbody>
</table>
(So "table-rows" would be the selector of the TableRowsComponent here) The template of the TableRowsComponent would be something like:
<tr>
<td> foo </td>
<td> bar </td>
</tr>
<tr *ngIf="something">
....
</tr>
<tr *ngFor="..">
...
</tr>
If we were to do this then the result looks like this:
<table class>
<tbody>
<table-rows>
<tr>
...
</tr>
<tr>
...
</tr>
</table-rows>
<table-rows>
<tr>
...
</tr>
<tr>
...
</tr>
</table-rows>
</tbody>
</table>
Unfortunately the < table-rows > elements mess up the rendering of the table. How to solve this problem? Is there maybe a way to make angular2 not render the < table-rows > elements?