json数据来自具有html标记的rest API,例如
(content: {rendered: "<p><strong>Destination Covered:</strong> Lorem Ipsum; Dolor</p>↵", protected: false})
如何在angular7中将HTML标签转换为文本
angular 7中的{{x.content.rendered}}
<p><strong>Destination Covered:</strong> Lorem Ipsum; Dolor</p>
以HTML格式显示代码
结果应该在角度6-7中没有HTML标记
目的地覆盖: Lorem Ipsum;Dolor
发布于 2019-05-20 15:34:20
你能用这个吗?对我很管用
var f = '<p><strong>Destination Covered:</strong> Lorem Ipsum; Dolor</p> ';
var e = document.createElement("div");
e.innerHTML = f;
document.getElementById("foo").innerText = e.innerText;
请leme知道吗?
发布于 2019-08-08 18:16:44
https://stackoverflow.com/questions/56215572
复制相似问题