後從陣列只要採取6條爲一次,顯示所有6確保您有需要記錄的DVD不是從x。並且不要忘記使用NG-如果與$索引%6
<div ng-app="myApp" ng-controller="MyController">
<table border="1" width="100%">
<tr ng-repeat="x in DVDs" ng-if="$index % 6 === 0">
<td>
{{DVDs[$index].title}}
</td>
<td>
{{DVDs[$index+1].title}}
</td>
<td>
{{DVDs[$index+2].title}}
</td>
<td>
{{DVDs[$index+3].title}}
</td>
<td>
{{DVDs[$index+4].title}}
</td>
<td>
{{DVDs[$index+5].title}}
</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', ['ngDragDrop']);
app.controller('MyController', function ($scope,$http,$sce)
{
$scope.DVDs = [
{
"title":"7 Assassins",
"image":"images/7Assassins.jpg",
"description":"When gold goes missing in ancient China, royal guards entrusted with its recovery realize they are not the only people in pursuit.",
"genre":"Action",
"available":"true",
"rating":"5",
"releaseYear":"2013"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
},
{ "title":"Doctor Who",
"image":"images/DoctorWho.jpg",
"description":"The further adventures of the time traveling alien adventurer and his companions.",
"genre":"Adventure",
"available":"true",
"rating":"8",
"releaseYear":"2005"
}
];
});
</script>
手柄成功它在你的數據水平。創建一個元素的主數組,每個元素包含最多六個(或任何需求)條目。 然後在這個嵌套數組上做一個嵌套的ng- 這是你想要的還是其他的東西? –