【发布时间】:2015-09-02 23:20:58
【问题描述】:
我正在尝试从我目前使用 AngularJS 在网页上生成的表中提取原始 HTML 数据表。
举个简单的例子:
角度代码:
<table>
<tr ng-repeat="customer in customers">
<td>{{customer.firstname}}</td>
<td>{{customer.lastname}}</td>
</tr>
</table>
我不想编写两种不同的解决方案,因此想使用 AngularJS。
是否可以使用 AngularJS 提取原始 html 代码?即以下内容:
<table>
<tr>
<td>John</td>
<td>Smith</td>
</tr>
<tr>
<td>Fred</td>
<td>Bloggs</td>
</tr>
...etc
</table>
【问题讨论】:
-
你应该考虑它在服务器端渲染。也许这会有所帮助:stackoverflow.com/questions/16232631/…
-
我可能会走那条路,所以它是一个有用的指针。如果可能的话,我宁愿把它保留在客户端。
标签: javascript html angularjs