编辑这是跨多个元素的Angular.js ng-repeat的相似(或重复)
--
我有一个表,其行是通过ng-repeat生成的:
<tr ng-repeat="(key, value) in rows">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
由于种种原因,我真的更希望将其保留在<table>标记中,而不是几个inline-blocks中。
如何在每行下方添加另一行,例如伪代码
[ somehow-repeat ng-repeat="(key, value) in rows"]
<tr class="1">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
<tr class="1">
<td colspan="2">
</tr>
[ /somehow-repeat ]
据我所知(值得检查),我无法将TR包装在另一个元素中。只是脸颊:(表格不显示我的“以某种方式重复”元素是否为
所以-尽管处于ng-repeat中,有没有办法添加新行?
您可以使用重复开始和重复结束:
<tr class="1" ng-repeat-start="(key, value) in rows">
<td>{{a}}</td>
<td>{{b}}</td>
</tr>
<tr class="1" ng-repeat-end>
<td colspan="2">
</tr>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句