저는 Parse Server Javascript API를 사용하여 아래의 Parse Query를 호출하고 있습니다. 장치이라는 클래스가 있습니다. 포인터 개체는 입니다. Device_Type은 차례로 에 대한 포인터를 가지고 있습니다. 포인터입니다.중첩 포인터 데이터
deviceID를 inventoryItem에 성공적으로 표시 할 수 있지만 JSON 네트워크 리턴에 관련 데이터가 있음에도 불구하고 제조업체에 대해 정의되지 않습니다.
$scope.getDeviceItems = function() {
var query = new Parse.Query("Device");
query.include("Device_Type");
query.include("Device_Type.Manufacturer");
query.find({
success: function (results) {
$scope.deviceItems = [];
for (i = 0; i < results.length; i++) {
var d = results[i].get("Device_Type");
var m = results[i].get("Device_Type.Manufacturer");
var inventoryItem = {
deviceID: d.get("Device_ID"),
manufacturer: m.get("Manufacturer_Name")
}
};
};
};
};
중첩 포인터 데이터를 제조업체에 올바르게 얻으려면 어떻게해야합니까? 단지 구문 분석에서 JS 객체 해결
{
"results": [{
"objectId": "q3D2myHG3e",
"createdAt": "2017-07-30T22:28:05.035Z",
"updatedAt": "2017-09-19T20:40:05.580Z",
"Device_Type": {
"objectId": "Ksej3F2sdp5",
"Device_Name": "Device 1",
"createdAt": "2017-07-30T21:57:58.638Z",
"updatedAt": "2017-08-08T20:20:14.397Z",
"Manufacturer": {
"objectId": "3NahYBNIiC",
"Manufacturer_Name": "ABC Ltd",
"createdAt": "2017-07-30T21:56:40.557Z",
"updatedAt": "2017-07-30T22:13:07.425Z",
"Devices": {
"__type": "Relation",
"className": "DeviceType"
},
"__type": "Object",
"className": "DeviceManufacturer"
},
"__type": "Object",
"className": "DeviceType"
},
...
}]
}
지도 쉽게 작동합니다 위와 같이 일반 JS 객체를 사용하는 이유
당신은뿐만 아니라 당신의'json' 데이터를 게시 할 수 있습니까? 네가 성공 전화를 망쳐 놓은 것 같아. 일반적으로'results'를 전달할 때'$ scope.eurica = results.data'와 같은 것을해야합니다. 그러나 나는 확신 할 수 없습니다. 실제 데이터를 표시하면 더 쉬울 것입니다. – ZombieChowder
@ ZombieChowder JSON으로 질문을 수정했습니다. –