I have a lot of html tables that share the same 15 columns along with custom columns that are specific for each table. I would like to create these common 15 columns as a component that takes in a set of data and shows up as the 15 td's without a wrapper. I can't figure out how to create an Angular component that doesn't show the wrapper tag in the DOM and allows me to pass in input. Below is kind of what I'd like to do:
<tr *ngFor="let item of items">
<td>Column 1</td>
<my-common-columns [data]="item"></my-common-columns>
<td>Another column</td>
</tr>
Unfortunately with the above code, <my-common-columns>
tag shows up in the rendered DOM, which messes up the table. I can only have td
's under the tr
tag.
I also tried <ng-container *ngComponentOutlet="myCommonColumns">
since ng-container
's don't show up in the DOM, but I can't figure out how to pass data
into it.