Not able to set [innerHTML] of a html element


#1

Here is the HTML element:

<td [innerHTML]="options">
      </td>

And here is the typescript:

 this.options = "<button class='btn btn-success' (click)='addToCart(item)'> Add to cart </button>";

This could not able to set the innerHTML of element to tag just setting it to the string Add to cart.
How can I set it to a HTML element?


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.