Angucomplete-alt: Remote-API-handler not working as expected

蓝咒 提交于 2019-12-05 20:23:46

Ok, I've found a solution. Even though it's not specified at all in the docs, the directive expects a response like:

{"data": [Array of objects]}

Therefore, it works if I do it like:

$scope.search= function (userInputString, timeoutPromise) {
return $timeout(function () {
    return {"data": [{ "id": "1" }, { "id": "2" }, { "id": "3" }]};
}, 1000);

Hope it will help others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!