gpt4 book ai didi

Angular 2 : How to display data in html format in angular2 data binding?

转载 作者:太空狗 更新时间:2023-10-29 17:42:44 25 4
gpt4 key购买 nike

<分区>

我有来自数据库的产品数据包含标题、描述...描述是 html 格式的字符串,像这样:

<b>Name:</b> iPhone 5;<br>
<b>Membery:</b> 8GB;<br>
<b>Condition:</b> Brand new;<br />

如果应该这样显示:

名称:iPhone 5;

内存:8GB;

状况:全新

但是当我在 Angular2 中使用数据绑定(bind)时:{{product.description}},它显示为纯文本:

<b>Name:</b> iPhone 5; <br /><b>Memory:</b> 8GB;<br /><b>Condition:</b> Brand new;<br />

我应该如何将它正确地显示为 html ?没有用于绑定(bind)的 html 过滤器。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com