8
<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 Answer 1

23

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

<div [outerHTML]="'<b>HEY</b>'"></div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.