JSON에서 정보를 얻으려면 다음 코드를 사용합니다.
$http.get('http://localhost:3000/folder/'Id)
.success(function (response) {
console.log("response ", response);
console.log("words: ", response.result.all.Word);
})
.error(function (response) {
console.log("error");
});
하지만 배열의 정보를 얻을 수있는 문제가 있습니다 응답에서
TypeError: Cannot read property 'all' of undefined
내가 가진 : 당신의 도움에 대한
이response [Object, Object]
0: Object
_id: "543e95d78drjfn38ed53ec"
result: Object
all: ObjectWord: Array[17]
0: "word1"
1: "word2"
2: "word3"
...
감사합니다! 당신은 인덱스 누락
응답은 객체의 배열입니다. JSON 결과 개체에 따르면 첫 번째 배열 안에 있습니다. 인덱스 응답 [0] .result.all –