임 새로운 요소를 추가하는 방법 : 강조하고 아래에 달성하기 위해 노력하는 모음
$scope.Countries:[{Country:UK,City:London,Areacode:567},
{Country:USA,City:Texas,Areacode:987},
{Country:CHINA,City:XXX,Areacode:XXX}]
$scope.People= [{Fname:'John',Country:'USA'},{Fname:'Bob',Country:'UK'},];
내가가 국가 필드를 추가하는 하나의 콜렉션을 원하는 : 내가 찾아 수집 및 결과 컬렉션이 다음과 같이 매핑 된 국가에 따라 사람들 모음 :
$scope.Result=[{Fname:'John',Country:'USA',City:Texas,Areacode:987}
,{Fname:'Bob',Country:'UK',City:London,Areacode:567}];
사람이 사용 밑줄을 달성하는 방법에 대한 몇 가지 빛을 던질 수 있습니다.
고마워,'code' 아래에서 같은 것을 얻었습니다 var some_map = _ .지도($ scope.People, function (item) { var child = _. 여기서 ($ scope.Countries, {Country : item.Country}); item.City = child [0] .City; item.AreaCode = child [0] .Areacode; 반품 항목 : }}); 하지만 UR 코드는 훨씬 간단하고 깔끔합니다 ... – Andrea