我这个问题,真的很烦人,求大神帮忙解决,应该不能动态插入。用那个append方法~
html:
<tr ng-repeat="row in tableData">
<td ng-bind-html="getHtml(row) | to_trusted"> </td>
...
</tr>
js:
app.filter('to_trusted', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text);
};
}]);
前端完成之后展示的 代码
这样写的话,onclick 可以进去,但是用ng-click就会不生效,求大神解决~
是不是 function(sce) 和 return 后 的 $sce 不一致。