How to have AngularJS output escaped HTML [duplicate]

痞子三分冷 提交于 2019-11-28 07:10:42

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!