【发布时间】:2014-11-21 13:46:44
【问题描述】:
我正在使用角度 UI 选择。
https://github.com/angular-ui/ui-select
我在this plunkr查看了演示版
我想从远程服务获取数据。每次用户在文本字段中输入内容时。我想从远程服务中获取数据,并根据输入值过滤结果。
我写了一个网络服务,网络服务运行良好。
如何使用 angular ui select 从远程服务中获取数据?
目前我正在关注演示中的简单示例
<ui-select multiple ng-model="multipleDemo.colors" theme="select2" ng-disabled="disabled" style="width: 300px;">
<ui-select-match placeholder="Select colors...">{{$item}}</ui-select-match>
<ui-select-choices repeat="color in availableColors | filter:$select.search">
{{color}}
</ui-select-choices>
</ui-select>
availableColors 是一个预定义的数组。我不想事先定义数据数组。
我一直在 Internet 上寻找任何可能的文档或教程,但找不到任何有用的东西。
【问题讨论】:
标签: javascript html angularjs angular-ui