“ `标签1]中的输入文本字段>

问题描述 投票:1回答:4

我正在使用AngularJS创建一个下拉列表。这是代码。.

<div class="col-md-9">
  <input type="text" placeholder="Enter Module" list="names"
         ng-model="data.Name" />
  <select id="names" class="form-control" ng-model="data.Name"
          ng-change="SetCategory(data.Name)" name="name">
    <option value='' disabled selected>------------- select an option ----------</option>
    <option ng-repeat="e in BrData | filter:data.Name "
            value="{{e.Name}}">{{e.Price}}</option>
  </select>
</div>

NOTE

:列表是动态的,我正在使用AngularJS来获取数据。我需要在select标记内创建一个searchbar。但是Input标签不能嵌套在select标签中。该怎么办?

我正在使用AngularJS创建一个下拉列表。这是代码。

<...>[[
]
html angularjs combobox html-select
4个回答
2
投票

我的看法,这里有三个选项。


1
投票

您可以使用UI Bootstrap中的typeahead:https://angular-ui.github.io/bootstrap/#!#typeahead


0
投票

使用select2作为动态选项而不是HTML选择选项:这是使用js进行选择的链接:


0
投票

应付<select>噩梦

© www.soinside.com 2019 - 2024. All rights reserved.