I have a string response containing escaped HTML that I am trying to render inside a div using innerHTML. The table is not getting rendered. Instead i'm seeing the output as unescaped html with the table tags : <table width=583px><tr><td>Sunshine</td><td>Unicorns</td></tr></table>
. Is there a work around for this?
In my test.component.ts,
public testStringWithEscape = '<table width=583px><tr><td>Sunshine</td><td>Unicorns</td></tr></table>';
in test.component.html,
<div [innerHtml]="testStringWithEscape"></div>
P.S: I know that we have solution for this in javascript/angular JS. But I'm specifically trying to understand if there is a way in Angular4/6/8.