I am working on quite a big fetch from a public API with hearthstone cards, The problem I am facing is that the ng-repeat does not seem to be responding, it gives me:(我正在使用带有炉石卡的公共API进行大量获取,我面临的问题是ng-repeat似乎没有响应,这给了我:)
<!-- ngRepeat: item in data -->
In the HTML code, and the HTML code inside the ul tag is not showing up at all.(在HTML代码中,并且ul标记内的HTML代码根本没有显示。)
Index.html: (The corresponding part of the HTML document.)(Index.html: (HTML文档的相应部分。))
<ul>
<li ng-repeat="item in data">
<div class="col-xs-12 col-md-16">
<div class="prod-info-main prod-wrap clearfix">
<div class="row">
<div class="col-md-7 col-sm-12 col-xs-12">
<div class="product-deatil">
<p class="price-container">
<span>{{item.Basic.cardId}}</span>
</p>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
Controller:(控制器:)
var produkterControllers = angular.module('produkterControllers', []);
// Skapar kontrollen produktController som h?mtar data fr?n js/data.json
produkterControllers.controller('minApiFunktionController', function myController($scope, $http) {
fetch("https://omgvamp-hearthstone-v1.p.rapidapi.com/cards", {
"method": "GET",
"headers": {
"x-rapidapi-host": "omgvamp-hearthstone-v1.p.rapidapi.com",
"x-rapidapi-key": "8ad5a16c67mshed80ba15c31ab54p141ec5jsnfbff6480fd40"
}
})
.then(function (response) {
return response.json();
}).then(function (data) {
console.log('this is the data, ', data);
$scope.cards = data;
});
});
I have disabled the service worker and all extra functionality to not disrupt with loading time for the API, but it seems that the HTML document completes the loading time before the API fetch is complete, and therefore it is not showing.(我已禁用服务工作者,并且所有其他功能都不得中断API的加载时间,但似乎HTML文档已在API提取完成之前完成了加载时间,因此未显示。) This is my thought but after a lot of looking through the docs I am stuck at this point, What am I missing?(这是我的想法,但是在仔细阅读了文档之后,我被困在这里,我缺少了什么?)
ask by Joakim Engqvist translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…