我有这样的ng-bind
<p ng-bind-html="decodeText(item.description)"></p>
Run Code Online (Sandbox Code Playgroud)
使用decodeText
$scope.decodeText = function (data) {
return data
}
Run Code Online (Sandbox Code Playgroud)
但是,以下json style="color:#ff0000;"在渲染时会丢失style属性
[{"title":"I am here","date_received":"Feb 28, 2014","description":"<p>EE)\u00a0 <span style=\"color:#ff0000;\"> accepted<\/span><\/p>\n<p>HH)\u00a0 <span style=\"color:#ff0000;\">I am\nhere; <\/span><strong>\u00a0<\/strong><\/p>"}
Run Code Online (Sandbox Code Playgroud)
是什么导致了这个?
angularjs ×1