在 Angular.js 中使用 markdown 模块,它不会转向 html 元素
use markdown module in Angular.js , it doesn't turn to the html element
我在 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 ?
使用 ng-bind-html
代替 ng-bind
。
我在 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 ?
使用 ng-bind-html
代替 ng-bind
。