【发布时间】:2023-03-12 17:21:01
【问题描述】:
我尝试通过 angucomplete-alt (https://github.com/darylrowland/angucomplete) 使用远程数据:
<angucomplete-alt id="searchfield"
pause="100"
remote-url="search.php?searchstr="
remote-url-data-field="results"
title-field="title"
description-field="description"
minlength="1"
input-class="form-control form-control-small"/>
我的 PHP 文件如下所示:
$ds = array('title' => 'title', 'description' => 'some text');
$response = array ("results" => $ds);
print_r(json_encode($response));
exit;
因此,在搜索任何内容时应该始终只有一个结果。但只有消息“未找到结果”。 JSON-Array 我做错了什么?
【问题讨论】: