Html 如何在内部添加搜索框<;选择>;带ng选项的标记
我需要添加搜索框内选择标记与ng选项Html 如何在内部添加搜索框<;选择>;带ng选项的标记,html,angularjs,ng-options,search-box,Html,Angularjs,Ng Options,Search Box,我需要添加搜索框内选择标记与ng选项 <select class="form-control" ng-model="modelname" ng-options="category.id as category.name for category in Categories ng-change="getSubCategory()"> <option><--search box should be here--></option> </s
<select class="form-control" ng-model="modelname" ng-options="category.id as category.name for category in Categories ng-change="getSubCategory()">
<option><--search box should be here--></option>
</select>
当用户点击按钮时,您可以设置搜索
值。
活样本:
模板:
<label>
Search Value: <input ng-model="filter">*emphasized text*
</label><br>
<label>
Search Key:
<select ng-model="key">
<option value="$">Any</option>
<option value="number">Student Number</option>
<option value="region">Student Region</option>
</select>
</label>
<button ng-click="setfilter()">search</button>
您不能使用标准html。你必须创建一些定制的东西——沿着这些线的东西
<ul class="custom-select">
<li class="custom-select__option" ng-repeat="o in $ctrl.options"><input type="search"/></li>
<ul>
这并不难创造,但这是你需要走的方向 使用Bootstrap选择实时搜索:谢谢shudham,但我需要在下拉列表中添加搜索框谢谢回答
<ul class="custom-select">
<li class="custom-select__option" ng-repeat="o in $ctrl.options"><input type="search"/></li>
<ul>