javascript - AngularJS ng-bind-html 不呈现列表标签

标签 javascript html angularjs ng-bind-html

我有一个简单的 HTML 文档,例如...

<ol>
    <li><strong>Test 1</strong></li>
    <li><strong>Test 2</strong></li>
</ol>

...我想将它绑定(bind)到 divng-bind-html ,但 HTML 标记 <ol> (或 <li>)未呈现。

我得到的结果是:

<strong>Test 1</strong>
<strong>Test 2</strong>

有什么想法吗?

最佳答案

为了使用 ng-bind-html,您需要在应用声明中包含 ngSanitize

关于javascript - AngularJS ng-bind-html 不呈现列表标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46425868/

相关文章:

javascript - 如何访问 Node 中的 `primordials` 对象?

javascript - 如何在提交表单时关闭模态弹出窗口?

html - 根据功能而不是内容模型列出时,HTML 元素的分类名称是什么?

javascript - 使用 ng-repeat、ng-click 和 $scope

javascript - 滑动检测和点击检测

javascript - 使用html打开大写的android和ios键盘

javascript - ScrollTo 不适用于滚动快照和 100vh 容器

javascript - 值显示不准确

javascript - Angular 模板中的 Concat 范围

angularjs - Node.js在 Protractor 中有什么用?