0
A
回答
1
在HTML中具有角:
<!-- assuming myArray is a variable on $scope object -->
<div ng-repeat="innerArray in myArray">
<div ng-repeat="value in innerArray">
{{ value }}
</div>
</div>
还是在JS,使用for
-loops:
var myArray = [[45,67,4],[7.8,6.8,56],[8,7,8.7]];
for (var i = 0; i < myArray.length; i++) {
var innerArray = myArray[i];
// loop through inner array
for (var j = 0; j < innerArray.length; j++) {
var myValue = innerArray[j];
console.log(myValue);
}
}
1
通过采用NG-重复:
<div ng-repeat="subArray in masterArray">
<div ng-repeat="element in subArray">
{{element}}
</div>
</div>
将产生的结果45 67 4 7.8 6.8 56 8 7 8.7
在javascript中(angularjs它没有必要在这里)
masterArray.forEach(function(subArray) {
subArray.forEach(function(element) {
console.log(element);
});
});
相关问题
- 1. Angularjs通过多个json数组遍历
- 2. 多个孔遍历数组
- 3. 遍历PHP多维数组
- 4. PHP遍历多维数组
- 5. 遍历多维数组
- 6. numpy遍历多维数组
- 7. 遍历多维数组
- 8. 遍历数组
- 9. 遍历数组
- 10. 遍历数组
- 11. 遍历数组
- 12. 遍历数组
- 13. 遍历数组
- 14. 遍历数组
- 15. 遍历数组
- 16. 遍历数组
- 17. 循环遍历多个标签数组
- 18. 遍历PHP中的数组
- 19. 遍历jquery中的数组
- 20. C中的数组遍历#
- 21. F中的数组遍历#
- 22. 遍历一个BPEL数组
- 23. .filter遍历一个数组
- 24. 通过查看多个值的数组遍历数组
- 25. 遍历数组值
- 26. php数组遍历
- 27. typoscript - 遍历数组?
- 28. 遍历数组树?
- 29. ç遍历数组
- 30. jquery遍历数组