각도의 ng-repeat 지시어를 사용하여 테이블에 데이터를 뱉어내는 데 이상한 문제가 있습니다.angular ng-repeat - 컬렉션에있는 각 항목이 컬렉션에있는 항목 수 (이상한)로 반복됩니다.
컬렉션의 항목 수 당 컬렉션의 각 항목을 반복하는 것으로 보입니다. 그래서이 예에서는 5 개의 항목이 있습니다. 각 항목은 컬렉션의 5 개 항목 각각을 한 번 뱉어 내기보다는 다섯 번 반복됩니다.
바이올린 : http://jsfiddle.net/Boovius/pZkrq/6/
<div ng-app>
<div ng-controller='channelsCtrl'>
<table>
<tr ng-repeat='channel in channels'>
<td >{{channel.title}}</td>
<td >
<button type='button' class='btn-danger'>Delete</button>
</td>
</tr>
</table>
</div>
</div>
function channelsCtrl($scope) {
var data = [{
"title": "Sports"
}, {
"title": "Adventure" },
{
"title": "Shorts"},
{
"title": "Beauty"},
{
"title": "Spirituality"
}]
$scope.channels = data;
}
왜 이것이 채용 테스트와 너무 흡사합니까? – Andyrooger