我試圖調用一個雙重嵌套的ng-repeat來遍歷對象中的對象,並且它不起作用。我使用的表(TR,TD)嵌套的ng-repeat無法正常工作
這是我的HTML代碼:
<tr ng-repeat="row in rows">
<td ng-repeat="item in row">
{{item}}
</td>
</tr>
這是我的數據對象:
$scope.rows = [["10:00", "0"],["12:00","1"]]
但表不顯示任何信息。我做錯了什麼?謝謝!
UPDATE
的計算器例子做工精細,對不起。
用我原來的數據數組不起作用:
[["10:00","0","0","3","0","0","0","0"],
["12:00","0","0","3","0","0","0","0"],
["14:00","0","0","3","0","0","0","0"],
["16:00","0","0","3","0","0","0","0"],
["18:00","0","0","3","0","0","0","0"],
["20:00","0","0","3","0","0","0","0"],
["22:00","0","0","3","0","0","0","0"]]
我想創造的東西,如:
並沒有被打印在所有(沒有TR或TD標籤)表或只是在{{項目}}沒有被填充模式是什麼? – Seonixx
它適用於我,如果你刪除'ítem'中的尖銳i(í)並使用'item'代替 – user2718281
ng-repeat不會創建td – pekpon