在Angular.js中使用markdown模块,它没有转向html元素

时间:2015-06-16 12:06:10

标签: angularjs markdown

我在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页面中的结果是

enter image description here

html元素没有解析为html元素,它们是toString进入html,如何将其解析成html?

1 个答案:

答案 0 :(得分:1)

使用ng-bind-html代替ng-bind