angular JS在页面里3层循环map
<div id="card" style="display:none;"> <div> <ul> <li ng-repeat="info in projectBacklog" class="card"> <span class="proNote">{{info.projectNote}}</span> <ul> <li ng-repeat="(key,value) in projectBacklog[$index+1].backlog">//backlog是projectBacklog里的map;key value可以循环String类型的map <span class="objName">{{key}}</span> <span class="objName">{{value}}</span> </li> </ul> </li> </ul> </div> </div>
for(var i in $scope.roleBtList){ $scope.roleNotHaveDevice={}; for(var j in $scope.deviceList){//$scope.roleBtList[i].BtLockList if($scope.roleBtList[i].BtLockList[j]==undefined){ $scope.roleNotHaveDevice[j]=$scope.deviceList[j]; }else{ continue; } } $scope.roleHaveBtList={}; for(var j in $scope.roleBtList[i].BtLockList){ $scope.roleHaveBtList=$scope.roleBtList[i].BtLockList[j]; } }