【发布时间】:2018-06-11 07:22:01
【问题描述】:
我有 n 条来自后端的记录作为数组中的 HTML。我需要在我的视图中将 HTML 响应显示为 HTML。我试过 ng-bind-html ,但它取最后一个值。需要帮助。
$scope.res= "data": [
{
"jd": "<p>this jd1</p>"
},
{
"jd": "<li>this jd2</li>"
},
{
"jd": "<ul>this jd3</ul>"
},
{
"jd": "<p>this jd4</p>"
}
]
}
HTML:
<div ng-repeat="item in res">
<div ng-bind-html ="item.jd">
</div>
【问题讨论】: