如何遍历 angularjs 中的对象数组

How to loop through array of objects in angularjs

我有一个这样的对象:

{
"batman":[{"applicantSkillID":"htl2","rating":3,"applicantInterviewerID":"usr1","applicantInterviewerName":"batman","applicantSkillName":"HTML"},
{"applicantSkillID":"cs43","rating":5,"applicantInterviewerID":"usr1","applicantInterviewerName":"batman","applicantSkillName":"css"}],

"Superman":[{"applicantSkillID":"ht12","rating":3,"applicantInterviewerID":"usr2","applicantInterviewerName":"Superman","applicantSkillName":"HTML"},
{"applicantSkillID":"cs43","rating":3,"applicantInterviewerID":"usr2","applicantInterviewerName":"Superman","applicantSkillName":"css"}]
}

现在我正在尝试 applicantInterviewerName 明智地显示数据(蝙蝠侠的评分、超人的评分等..)

只有一个 applicantInterviewerName 我可以通过这样获取第一个对象索引来做到这一点:

<tbody class="table text-left boxShade displayTable">
    <tr ng-repeat="feedBack in c.data.interviewerFeedback">
        <td class="skillName" id="{{feedBack.applicantSkillID}}"> {{feedBack.applicantSkillName}}</td>
        <td>
            <div class="inputRangeDiv">
                <input class="inputRangeInputSlilder"
                   ng-init="skillScoreForm.skill[feedBack.applicantSkillID] = feedBack.rating"
                   ng-model="skillScoreForm.skill[feedBack.applicantSkillID]"
                   value="0"  
                   oninput="skillOutput.value = skillInput.value"
                   id='skillInput' type="range"
                   min="0" max="5"  ng-disabled="true" />

            </div>
        </td>
        <td>
            <div class="inlineFlex">
                <output id="skillOutput" class="output">{{feedBack.rating}}</output>
                <p class="applicantCutoffOutputSufixModalTable">/5</p>
            </div>
        </td>
    </tr>
</tbody>

我怎么能做到这一点我想我确定我需要使用两个 ng-repeats 一个用于 applicantInterviewerName 一个用于 skills 但不知道如何实现它.?

试试这个:

var obj = {
 "batman": [{
   "applicantSkillID": "htl2",
   "rating": 3,
   "applicantInterviewerID": "usr1",
   "applicantInterviewerName": "batman",
   "applicantSkillName": "HTML"
  },
  {
   "applicantSkillID": "cs43",
   "rating": 5,
   "applicantInterviewerID": "usr1",
   "applicantInterviewerName": "batman",
   "applicantSkillName": "css"
  }
 ],

 "Superman": [{
   "applicantSkillID": "ht12",
   "rating": 3,
   "applicantInterviewerID": "usr2",
   "applicantInterviewerName": "Superman",
   "applicantSkillName": "HTML"
  },
  {
   "applicantSkillID": "cs43",
   "rating": 3,
   "applicantInterviewerID": "usr2",
   "applicantInterviewerName": "Superman",
   "applicantSkillName": "css"
  }
 ]
};

function MyCtrl($scope) {
    $scope.items = obj;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app ng-controller="MyCtrl">
    <div ng-repeat="(key,value) in items">
      <div ng-repeat="data in items[key]">
        <span>Name : </span>{{data.applicantInterviewerName}} , <span>Rating : </span>{{data.rating}}
      </div>
    </div>
</div>