use markdown module in Angular.js , it doesn't turn to the html element

258 Views Asked by At

i use the markdown module in node.js , when i get some text from mongodb , i turn it to markdown :

newsList.forEach(function (news) {
    news.publishContent = markdown.toHTML(news.publishContent);
})

and send the data to the html via angular :

<p ng-bind="nl.publishContent" ng-show="!isEdit"></p>

but the result in the html page is

enter image description here

the html elements doesn't resolve into html elements , they are toString into the html , how to make it resolve into html ?

1

There are 1 best solutions below

2
On BEST ANSWER

Use ng-bind-html instead of ng-bind.