Simpler again.
App.filter('unsafe', ['$sce', function ($sce) {
return function (val) {
return $sce.trustAsHtml(val);
};
}]);
Usage:
<any ng-bind-html="content | unsafe"></any>
For more on html binding check the docs here.
Just a warning: make sure you actually trust the html, or you could be opening a hole in your sites security.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…