0
我们在我们的应用程序中使用AngularJS v1.5.8。我正在寻找一种方法来显示下拉菜单,但也允许输入新的值。我已经检查了这个Manually type in a value in a "Select"/Drop-down HTML list?并试过datalist(在Google Chrome中没有工作),也查看了http://selectize.github.io/selectize.js/和http://jsfiddle.net/69wP6/4/我想知道angularJ是否已经存在,所以我不会重新发明轮子。AngularJS下拉式输入值的能力
我当前的代码是这样的
<input type="text" name="newRowValue" id="newRowValue" class="form-control"
list="rowValues" ng-model="newRowValue"
placeholder="@Labels.typeOrSelect"/>
<datalist id="rowValues" name ="rowValues"
class="form-control" ng-model="rowValue">
<option ng-repeat = "possibleValue in metaData.allPossibleValues| filter: {attributeId: currentMatrixTemplate.rowAttributeId}"
value="{{possibleValue.attributeId}}" ng-show="possibleValue.hidden==false || showHidden">{{possibleValue.valueName}}
</option>
</datalist>
不在Chrome中正确显示。任何想法都可以通过输入新值的方式轻松实现?
谢谢,看起来像我需要http://angular-ui.github.io/ui-select/ - 将尝试它。 – Naomi
我检查过文档和样本,但没有看到我的案例。我需要能够选择一个值,也可以键入值,并能够添加该值 – Naomi
@naomi看看这个页面:http://angular-ui.github.io/ui-select/demo-select2-与-bootstrap.html。这是新版本,但看起来像旧的。 – Ben