У меня некоторый контроллер содержит значения $ scope, которые представляют собой строку html и переменную
$scope.variableText="value of variable";
$scope.htmlString = "<b>HP LaserJet 1020</b> printer provides ________________ dpi printing. {{variableText}}";
и в виду элемент DOM, который я использовал
<span><ANY ng-bind-html="htmlString | unsafe"></ANY></span>
для доверия как html я использую эту функцию фильтра,
app.filter('unsafe',function($sce)
{
return $sce.trustAsHtml;
});
он успешно дает результат как вывод HTML, но не будет анализировать {{variableText}}
Принтер HP LaserJet 1020 обеспечивает печать с разрешением dpi. {{}} VariableText
Стараться сделать
<span><ANY ng-bind-html="htmlString | unsafe:this"></ANY></span>
app.filter('unsafe', ['$sce', '$compile', function ($sce, $compile) {
return function (input, scope) {
//create an angular element. (this is still our "view")
var el = angular.element(input);
//compile the view into a function.
var compiled = $compile(el);
//bind our view to the scope!
//(try commenting out this line to see what happens!)
compiled(scope);
return $sce.trustAsHtml(el);
};}]);