AngularJS中的ng-bind-html指令用于将HTML元素的innerHTML绑定到应用程序数据,并从HTML字符串删除危险代码。对于ng-bind-html指令,必须使用$ sanitize服务。所有HTML元素都支持它。
句法:
Contents...
示例:此示例说明了ng-bind-html指令。
ng-bind-html Directive
GeeksforGeeks
ng-bind-html Directive
输出: