I'm currently working on a Mean stack app and I'm building a reusable table component on my angular side. Currently with "hardcoded" tabes I do the usual that you see in tutorials to display a table.
<tr *ngFor="let car of cars">
<td>{{ car.name }}</td>
<td>{{ car.make }}</td>
</tr>
However in my reusable component, I generate this html into a variable called tdHTML. I'm trying to have tdHTML act the same as the td's from above however when I try the following
<tr *ngFor="let car of cars" [innerHTML]="this.tdHTML"></tr>
I do not get the expected output. Instead, my table will be populated with the actual text "{{ car.make }}" etc instead of the values binded to these variables.
How do I get the value associted with {{ car.make }} instead of the text using the above method?
P.S using Angular 2 incase that's relevant info. Also unsure if the title is descriptive enough.