angularjs表达式中的HTML内容,如何不转义,直接表现为html元素
方法一: var app = angular.module('myApp',['ngSanitize']);
3.<p ng-bind-html=”msg”></p>; 方法二: angular.module('myApp')
.filter('to_trusted',['$sce',function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
3.<p ng-bind-html=”msg | to_trusted”></p>; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |