鍍金池/ 問答/HTML5  HTML/ 請(qǐng)問怎么遍歷children 用ng-repeat

請(qǐng)問怎么遍歷children 用ng-repeat

$scope.dataList = [
          {
              'id':'john',
              'children':[
                  {
                        'id':'1',
                      'state':'tt'
                  }
              ],
              'children':[
                  {
                      'id':'2',
                      'state':'tt'
                  }
              ]
          }
      ];

只有一次ng-repeat

回答
編輯回答
陌離殤
<div ng-repeat="item in dataList">
  {{item.id}}
  <div ng-repeat="citem in item.children">
    {{citem}}
  </div>
</div>
2017年2月13日 09:00