Multiple ng-repeat on single element

前端 未结 5 432
慢半拍i
慢半拍i 2020-12-11 03:17

Is this possible to achieve a code like this:-


       {{data}} {{value}}
 
<         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 04:04

    If you have, for any reason, two arrays with the same length and where their contents are corresponding (array1[0] correspond to array2[0], ..., array1[n] correspond to array2[n]), you can use AngularJS's track by (which was introduced for the 1st time in the version 1.1.4) like this for example :

    
    
    
    {{ name }} is {{ ages[$index] }} years old.

    Hope that can help.

提交回复
热议问题