HTML 未在 Jade 中呈现
HTML not rendering inside Jade
我正在用 node.js、express、angular.js 和 jade 建立一个网站。我目前正在测试博客帖子上的 html 标签,但似乎不起作用。
我现在专注于航向。为什么浏览器不将其呈现为 HTML?顺便说一句,我在 chrome 中对此进行了测试,但我得到了相同的结果。这是玉代码:
div(ng-repeat='post in posts')
h3
|{{post.title}}
这是 mongodb 记录(相关内容):
"title": "<strong>This text is strong</strong>",
我该怎么做才能解决这个问题?
尝试使用 ngBindHtml 指令:
div(ng-repeat='post in posts')
h3
span(ng-bind-html-unsafe='post.title')
我正在用 node.js、express、angular.js 和 jade 建立一个网站。我目前正在测试博客帖子上的 html 标签,但似乎不起作用。
我现在专注于航向。为什么浏览器不将其呈现为 HTML?顺便说一句,我在 chrome 中对此进行了测试,但我得到了相同的结果。这是玉代码:
div(ng-repeat='post in posts')
h3
|{{post.title}}
这是 mongodb 记录(相关内容):
"title": "<strong>This text is strong</strong>",
我该怎么做才能解决这个问题?
尝试使用 ngBindHtml 指令:
div(ng-repeat='post in posts')
h3
span(ng-bind-html-unsafe='post.title')