Help me display data with angular 2. Im used [innerHtml] but display like image
<div id="decode-html" [innerHTML]="Detail">
</div>
My string Detail
<p>Tập 7 &quot;Bước nhảy ng&agrave;n c&acirc;n&quot; sẽ l&ecirc;n s&oacute;ng VTV3 v&agrave;o l&uacute;c 21h15 Chủ nhật 16/10/2016.</p>
Thanks for the help!
答案 0 :(得分:0)
You can't specify innerHTML from HTML. .innerHTML
is a JavaScript property.
You need HTML:
<div id="decode-html">
</div>
Then you need JavaScript:
var detail="the string you want to insert";
document.getElementById("decode-html").innerHTML=detail;
If you're trying to use typescript in Angular and you don't yet know HTML, you've got a loooong way to go...