0
我將我的文章保存在.json文件中。我喜歡的每篇文章都保存在另一個連接到我的數據庫的php文件中。AngularJS合併數組ng-repeat
a.likesA = [];
$http({
method: 'GET',
url: 'data/get_likes.php'
}).then(function(response) {
a.likesA = response.data;
console.log(response.data);
}, function(error) {
console.log("Likes konnten nicht geladen werden: " + error.status + error.statusText);
});
a.labs = []; //declare an empty array
$http({
method: 'GET',
url: 'data/lab.json'
}).then(function(response) {
a.labs = response.data;
//console.log(response.data.length);
}, function(error) {
console.log("JSON konnte nicht geladen werden: " + error.status + error.statusText);
});
我想顯示每個帖子與相應的相似數字。
我想這:ng-repeat="lab in combined = labs.concat(likesA)
但後來我得到的,而不是3。(我目前在我以.json 3個)
將創建小提琴,所以我們可以幫助您更好地 – 2017-08-26 14:23:42