我在node.js中使用markdown模块,当我从mongodb获取一些文本时,我将其转为markdown:
newsList.forEach(function (news) {
news.publishContent = markdown.toHTML(news.publishContent);
})
并通过angular:
将数据发送到html<p ng-bind="nl.publishContent" ng-show="!isEdit"></p>
但是html页面中的结果是
html元素没有解析为html元素,它们是toString进入html,如何将其解析成html?
答案 0 :(得分:1)
使用ng-bind-html
代替ng-bind
。