我想在一个XML中添加属性trust
。我的问题是,当前我将value
作为string
,因此无法使用以下代码:
trusted (escaped) {
escape.filter('to_trusted', ['$sce', function($sce) {
return function(text) {
return $sce.trustAsHtml(text);
}
}]);
}
能否将一个 字符串
转换成 XML
?我想要转换已经被 转义
的字符串。