在ionic 3中的html unicode下无法阅读InnerHTML

时间:2018-10-02 12:25:38

标签: javascript html angular

my.ts文件

this.posts = [{"title":"title 1","body":"It\\u2019s a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum.\\n"},{"title":"title 2","body":"It is a long \\u2012 established fact that a reader will be distracted by the readable content of a page when looking at its \\u2045 layout. The point of using Lorem Ipsum\\n"}]

请注意,我正在从服务器获取json数组

HTML文件

<div [innerHTML]="post.body"></div>

输出 enter image description here

我需要这个输出 enter image description here

预先感谢

0 个答案:

没有答案