qianjiahao
qianjiahao

Reputation: 399

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

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 ?

Upvotes: 2

Views: 259

Answers (1)

Andrew
Andrew

Reputation: 7458

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

Upvotes: 1

Related Questions