情况:
我有一个发送电子邮件的 Angular 应用程序。
共有三个字段:地址 - 主题 - 文本。
地址字段是使用 Angular ui-select 构建的
电子邮件地址可以从列表中选择,也可以重新输入。
问题是我无法创建新条目。
文档中写道,为了输入新值,可以使用属性 tagging .
但我不知道为什么,没有和我一起工作。
代码:
(简单的新标签添加示例)
<ui-select multiple tagging tagging-label="(custom 'new' label)" ng-model="multipleDemo.colors" theme="bootstrap" 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>
$scope.availableColors = ['Red','Green','Blue','Yellow','Magenta','Maroon','Umbra','Turquoise'];
$scope.multipleDemo = {};
$scope.multipleDemo.colors = ['Blue','Red'];
骗子:
http://plnkr.co/edit/T55LeKK66Idb3lD8DDPz?p=preview
如您所见,无法插入新值。
问题:
如何在 Angular ui-select 中正确插入新值?
最佳答案
给出的 plunkers 使用 0.8.2。标签适用于 0.8.3。
关于javascript - Angularjs ui-select 标记不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27225834/