我在JSON内部有一些值,如1000, 2000, <b>3000</b>, <4000>, <b>5000</b>
作为API响应。我想在一个表内呈现这个响应。所以我尝试了ng-bind-html。但它只显示具有3000,5000标签的值。我想显示所有值,1000,2000,4000作为一个纯字符串和3000,5000 BOLD /或任何其他HTML标记。从字符串呈现html标记
angular.forEach($scope.arr2.test,function(item)
$scope.res=$sce.trustAsHtml(item.amount);
return $scope.res;
});
在HTML方面,我有这样的事情
<td id="price" class="edit" ng-repeat="pro in d.procedure" ng-bind-html="valueCheck(d._id,pro._id,hos._id)"></td>
SE http://stackoverflow.com/questions/22536477/rendering-dynamic-htmlangularjs-content-content-content-content-content-after-ajax-call-in-angularjs –