在多个元素Angular.js NG-重复 [英] Angular.js ng-repeat across multiple elements

查看:133
本文介绍了在多个元素Angular.js NG-重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题已得到部分处理在这里:<一href=\"http://stackoverflow.com/questions/12979205/angular-js-ng-repeat-across-multiple-trs?answertab=active\">Angular.js在多个TRS NG重复

This question has been partly addressed here: Angular.js ng-repeat across multiple trs

然而,这只是一个变通真的,它实际上并没有解决核心问题,那就是:怎样可以一用在多个元素NG重复不带包装

However that is just a work-around really, it doesn't actually address the core issue, which is: how can one use ng-repeat across multiple elements without a wrapper?

例如,jquery.accordion要求你重复一个H3和div元素,一个人如何可以与NG-重复这样做呢?

For example, jquery.accordion requires you to repeat an h3 and div element, how could one do this with ng-repeat?

推荐答案

我们现在有这样的适当的支持,请访问:

We now have a proper support for this, please see:

这种变化,你现在可以做的:

with this change you can now do:

<table>
  <tr ng-repeat-start="item in list">
      <td>I get repeated</td>
  </tr>
  <tr ng-repeat-end>
      <td>I also get repeated</td>
  </tr>
</table>

这篇关于在多个元素Angular.js NG-重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆