-1
받은 편지함 상자에 유형 미리보기 기능을 구현해야하지만 $ http에서 응답을 받으면 유효하지 않은 JSON이 나옵니다. 그.
$scope.collections = function(val) {
return $http.get('/Documents/DocumentsList/', {
params : {
stk : val
}
}).then(
function(response) {
if (response.data.suggestions) {
$("[uib-typeahead-popup].dropdown-menu").css('display','block');
return response.data.suggestions
.map(function(item) {
return item.term;
});
};
});
};
JSON 응답 :
{} && {
"name": "John",
"age": 31,
"city": "New York"
}
잘못된 JSON을 수정하는 방법 VALI하는 방법 아래
내가
uib-typeahead="name for name in collections ($viewValue)"
각도보기 수준을 위해 사용하고 있습니다 d JSON을 입력하고 유효한 응답을 전달하십시오.
JSON? – Phil
JSON 응답에 '제안'이 표시되지 않습니다. 어떻게 작동 할 것이라고 기대하십니까? – Phil
@ Phil : 예, 맞습니다. JSON은 actula 응답이 아닙니다. JSON의 유일한 샘플 형식입니다. – CodeMan