Javascript 带自动完成功能的AngularJS选择
有谁能告诉我如何创建一个可编辑的搜索框(而不是自动完成),因为在自动完成中,只有当我们键入选择时才会出现,但在这种情况下,当我们没有键入任何内容时,所有显示为下拉框的选项,以及当我们键入任何内容时,显示的选项都应基于此进行过滤 应该像自动完成和选择一样工作 谁能告诉我一些解决方法吗 htmlJavascript 带自动完成功能的AngularJS选择,javascript,angularjs,select,autocomplete,Javascript,Angularjs,Select,Autocomplete,有谁能告诉我如何创建一个可编辑的搜索框(而不是自动完成),因为在自动完成中,只有当我们键入选择时才会出现,但在这种情况下,当我们没有键入任何内容时,所有显示为下拉框的选项,以及当我们键入任何内容时,显示的选项都应基于此进行过滤 应该像自动完成和选择一样工作 谁能告诉我一些解决方法吗 html <select ng-model="names" ng-options="person.name for person in persons | orderBy:'name'" ng-change=
<select ng-model="names" ng-options="person.name for person in persons | orderBy:'name'" ng-change="select()">
</select>
听起来像
演示-查看最后一个选择框
例如:
<ui-select ng-model="country.selected" theme="selectize" ng-disabled="disabled" style="width: 300px;">
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="country in countries | filter: $select.search">
<span ng-bind-html="country.name | highlight: $select.search"></span>
<small ng-bind-html="country.code | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
{{$select.selected.name}
尝试选择jQuery,并附带一个角度指示:我总是说:IE用户已经习惯了网络被破坏,为什么要在意呢?但说真的,如果你绝对需要支持IE8,那么我想你只需要在自己的指令中包装一些JQuery插件。
<ui-select ng-model="country.selected" theme="selectize" ng-disabled="disabled" style="width: 300px;">
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="country in countries | filter: $select.search">
<span ng-bind-html="country.name | highlight: $select.search"></span>
<small ng-bind-html="country.code | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>