두 개의 json이 있습니다. 예를 들어 첫 번째 JSON의 메 흐멧에서 2 Json 문서가 연관되어 있고 angularJS에 중첩되어 있습니다.
[ {"id":"1", "userID":"23"} , {"id":"2", "userID":"23"}, {"id":"3", "userID":"22"}]
1
[ {"id":"23", "name":"mehmet"} , {"id":"22", "name":"jack"} ]
2
은 (동료 아이디) 내가 원하는에 ... 2 개 항목 초 JSON을
mehmet (source first json)
id:1 (second json)
id:2 (second json)
jack(source first json)
id:3 (second json)
내 제어 ler :
.controller('ListviewCtrl', function($scope, $http, SERVER) {
$scope.topics = [];
function loadTopics(params, callback){
$http.get(SERVER.url+'/listtopic', {params: params})
.success(function(response){
var topics = [];
angular.forEach(response, function(result){
topics.push(result);
});
callback(topics);
});
};
$scope.tweetler = [];
function loadTweetler(params, callback){
$http.get(SERVER.url+'/tweet')
.success(function(response){
var tweetler = [];
angular.forEach(response, function(result){
tweetler.push(result);
});
callback(tweetler);
});
};
ng-repeat 및 list associate 2 json을 사용하는 방법은 무엇입니까?