How to render an innerHTML without adding a tag in Angular

Viewed 1743
<div [innerHTML]="'<b>HEY</b>'"></div>

Works well! But the problem is that I don't want the div or any other element to add to the page. I just want to render innerHTML content to page. I tried ng-container instead of div but it is not working. How can I make it happen ?

1 Answers

You can use [outerHTML] on the div and it will be replaced.

<div [outerHTML]="'<b>HEY</b>'"></div>
Related