私はバックエンドからエンコードhtmlを取得していますが、デコードできません。HTMLをtypeScriptでデコードする角度2
私はdecodeURIComponentとdecodeURIを試しました。
I got from server='
"<table style="background-color: white;">
<tbody>
<tr>
<td>
<div id="voucher">
<table>
<tr>
<td colspan="1" class="normal-left">ID:</td>
<td colspan="3" class="normal-left">ce203c7c804c4f258947adf3d63b2d7d</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</tbody>
</table>"
'
// This is my HTML
<ion-content padding>
<ion-list>
<ion-item>
<span [innerHtml]="aux"></span>
</ion-item>
</ion-list>
</ion-content>
私はのdocument.getElementById( "AUX")でのjQueryにデコードするために使用。innerHTMLの= $( '') .html(バウチャー).text();
しかし、角度2に類似しているかどうかはわかりません。
おかげ
、あなたが 'エスケープしていないサーバーの男を教えてください<' '<'などとしてその後、 'innerHTML'を使って挿入することができます。 –
innerHTMLは現在innerHtmlです。 –