【发布时间】:2017-03-21 16:43:16
【问题描述】:
我在 JSON 中有一些值,例如 1000, 2000, <b>3000</b>, <4000>, <b>5000</b> 作为 API 响应。我想在表格中呈现这个响应。所以我尝试了 ng-bind-html。但它只显示具有 3000,5000 等标签的值。我想显示所有值,1000,2000,4000 为纯字符串,3000,5000 为粗体/或任何其他 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>
【问题讨论】:
标签: javascript jquery angularjs