0
所以我就從角以下錯誤:
rooster in rooster.uren track by $index
但是,什麼是沒有,是創建:
Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys.
所以我做了以下固定它一噸板,而我的jSon只有4條線。
的JS:
angular.module("PixelFM").controller("grootRoosterController", function ($http) {
var that = this;
that.uren = [];
$http({
method: 'GET',
url: '/assets/scripts/GROOTROOSTERTEST.json'
}).success(function(data) {
that.uren = data;
});
});
一個重複重複的HTML:
<div class="col-md-6" ng-repeat="rooster in rooster.uren track by $index">
<div class="panel panel-default">
<div class="panel-body grootrooster">
{{rooster.name}}
</div>
</div>
</div>
而對於一些奇怪的原因,這段代碼的含義是輸出萬元面板,所有留下的空...
這可能怎麼樣?謝謝。
編輯
Json;
[
{"host": "Adjuh5", "showname": "", "hour": "1446674064", "cohost": "Finicky"},
{"host": "Beatgrid", "showname": "", "hour": "1446674064", "cohost": ""},
{"host": "Adjuh5", "showname": "", "hour": "1446674064", "cohost": ""},
{"host": "Finicky", "showname": "", "hour": "1446674064", "cohost": ""}
]
循環引用? 'ng-repeat =「公雞在rooster.uren軌道由$ index」'=>'ng-repeat =「r在rooster.uren軌道由$ index」' – Tushar
包括在您的問題的答覆json –
@EmirMarques我加了它 –