Please find the plnkr
I want to display some html preview. The html is already sanitized at the server (for eg: "<b>HELLO</b>"). How can I display the html form. In the example, I want to display myHtml2 as displayed for myHtml (first preview).
html
<div ng-controller="myController">
<div ng-bind-html="myHtml"></div>
<div ng-bind-html="myHtml2"></div>
<div >{{myHtml2}}</div>
</div>
js
myApp.controller('myController', ['$scope', '$sce', function myController($scope, $sce){
$scope.myHtml = "<b>HELLO</b>";
$scope.myHtml2 = "<b>HELLO</b>";
}]);
out
HELLO
<b>HELLO</b>
<b>HELLO</b>