How to have AngularJS output escaped HTML [duplicate]
At the same time $sce
service was introduced (angular 1.2), support for ng-bind-html-unsafe
directive was dropped. The new directive is ng-bind-html
. If you use this, the code should work as documented:
<div ng-bind-html="mail.htmlbody"></div>
Use this directive:
<div ng-bind-html="mail.htmlbody"></div>
Don't forget to use angular sanitize on your app module.
check here : http://docs.angularjs.org/api/ngSanitize