Javascript 角度指令ng bind html在某些情况下不起作用
我想我尝试了堆栈溢出的所有解决方案,但没有找到答案 我正在使用angular 1.4.4和ng repeat指令,我希望在表行中显示HTML注释。示例注释为“测试注释” 而且,当我写下这样的东西时,它也起作用了Javascript 角度指令ng bind html在某些情况下不起作用,javascript,html,angularjs,ng-bind-html,Javascript,Html,Angularjs,Ng Bind Html,我想我尝试了堆栈溢出的所有解决方案,但没有找到答案 我正在使用angular 1.4.4和ng repeat指令,我希望在表行中显示HTML注释。示例注释为“测试注释” 而且,当我写下这样的东西时,它也起作用了 <td ng-bind-html="'<b>abc</b>' | html"> <td> {{comment.Comment}} </td> 我的问题是,在我的示例中,如何使ng bind html工作?我构建了一个
<td ng-bind-html="'<b>abc</b>' | html">
<td>
{{comment.Comment}}
</td>
我的问题是,在我的示例中,如何使ng bind html工作?我构建了一个带有表的JSFIDLE,没有自定义过滤器,它可以正常工作。你确定你的应用程序模块中包含了ngSanitize吗?对已添加NgSanitize。我编辑了我的问题
<tbody ng-show="dataLoaded">
<tr ng-repeat="comment in comments | filter: commentFilter | commentFilter: customCommentFilter | limitTo: 10 : (currentPage*10-10)">
<td ng-bind="comment.Comment">
</td>
</tr>
</tbody>
<td>
{{comment.Comment}}
</td>
(function () {
'use strict';
var app = angular.module('app', [
// Angular modules
'ngCookies',
'ngRoute',
'ngAnimate',
'ngSanitize',
]);
...
...
})();
<tbody ng-show="dataLoaded">
<tr ng-repeat="comment in comments | filter: commentFilter | commentFilter: customCommentFilter | limitTo: 10 : (currentPage*10-10)">
<td ng-bind="comment.Comment">
</td>
</tr>
</tbody>