Angularjs 使用ng repeat更新表中的html元素
我正在尝试使用angular更新一个表,其中表的内容将包含一些html内容,如:Angularjs 使用ng repeat更新表中的html元素,angularjs,ng-repeat,Angularjs,Ng Repeat,我正在尝试使用angular更新一个表,其中表的内容将包含一些html内容,如: <ul> <li><span style=" font-weight: bold;">Text</span>: <a href="#" onclick="toggle_visibility('comment0');">comment</a> </li> </ul> 正文: 我无法让td编译h
<ul>
<li><span style=" font-weight: bold;">Text</span>:
<a href="#" onclick="toggle_visibility('comment0');">comment</a>
</li>
</ul>
- 正文:
我无法让td编译html,并尝试使用ngBindHtml和$compile。有什么建议吗
<table>
<tr data-ng-repeat="row in rows" >
<td>{{row.item1}}</td>
<td>{{row.htmlContent}}</td>
</tr>
</table>
{{row.item1}
{{row.htmlContent}
如果您在显示HTML时遇到问题,请查看
$sce
htmlContent
是否提供了带有角度代码的html,如ng click
/ng focus
?我已更新以显示html的示例