-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レスポンスの 'suggestions'が表示されません。どのようにそれがまったく動作すると思いますか? – Phil
@ Phil:はい、そうです。 JSONはactulaレスポンスではないJSONの唯一のサンプルフォーマット – CodeMan