我的作用域中有一个字符串,我并不总是知道我是否希望HTML转义。本质上,我有一个布尔值,它将说明是否应该转义HTML。下面是我的一些示例代码:$scope.html = false; // In this case the HTML *would* be escaped$scope.result = "<strike>foo</strike>bar";
$scope.html = t
我尝试使用$interpolate和ng-bind-html通过将作用域变量的数据绑定到html字符串。现在,当我的作用域变量的值更新ng-bind-html结果时,它并没有更新。-- This is update correctly -->
<div ng-bind-html="trustedHtml"></div> <!