Ionic framework

How to display HTML Code in ionic 4?

How to display HTML Code in ionic 4?, someone asked me to explain?

My text contains HTML content I wish to display but it only shows the HTML tags along with text.

Previously I used to display normal code,

  {{data?.MoreDetail}}

But result be like below,

render HTML code in ionic 4

In order to render HTML content in ionic 4, we need to use the following innerHTML attribute code,

<div [innerHTML]="data?.MoreDetail"></div>

Afterwards it works fine.

Post your comments / questions