Render HTML content in Ionic 3/4/5 Render HTML content in Ionic 3/4/5 angular angular

Render HTML content in Ionic 3/4/5


You should use the innerHTML attribute binding like this:

<div [innerHTML]="text"></div>

Please take a look at the Angular docs for more information.


in case you want to write it in paragraph you can do that by

<p><span [innerHTML]="htmlObject"></span></p><p><span>"{{title}}" is the <i>interpolated</i> title.</span></p><p>"<span [innerHTML]="title"></span>" is the <i>property bound</i> title.</p><p><img src="{{heroImageUrl}}"> is the <i>interpolated</i> image.</p><p><img [src]="heroImageUrl"> is the <i>property bound</i> image.</p>


<div [innerHTML]="text">

This solution works but some css not work in a html.Like we got proper data from backend but not applicable into innerhtml .