I am triying to output simples html unicode characters, for example ♣
from an expression.
I have tried to use ng-bind-html
and
You will have to use $sce (Strict Contextual Escaping), ngHtmlBindUnsafe was removed in 1.2
function myCtrl($scope,$sce){
$scope.html = $sce.trustAsHtml('♣');
}
Fiddle: http://jsfiddle.net/TheSharpieOne/uPw2U/
Furthernore, you can create a filter so that you will not need to escape everything in the controller.
.filter('html',function($sce){
return function(input){
return $sce.trustAsHtml(input);
}
})
HTML:
<span ng-bind-html="'♣'|html"></span>
Fiddle: http://jsfiddle.net/TheSharpieOne/uPw2U/1/