6
状况:角UI选标记
我具有有角的应用程序,发送电子邮件。 有三个字段:地址 - 主题 - 文本。 地址字段是使用角度构建的ui-select
电子邮件地址可以从列表中选择或重新输入。 问题是输入新的电子邮件地址。
我正在尝试使用标记属性来获取它。 但据我可以看到的是工作仅在UI的选择是由简单的字符串数组,而不是当由对象数组的
CODE:
<h3>Array of objects</h3>
<ui-select multiple tagging tagging-label="new tag" ng-model="multipleDemo.selectedPeople" theme="select2" ng-disabled="disabled" style="width: 800px;">
<ui-select-match placeholder="Select person...">{{$item.name}} <{{$item.email}}></ui-select-match>
<ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
<div ng-bind-html="person.name | highlight: $select.search"></div>
<small>
email: {{person.email}}
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
</small>
</ui-select-choices>
</ui-select>
<p>Selected: {{multipleDemo.selectedPeople}}</p>
PLUNKER:
http://plnkr.co/edit/nngkvjiQmI44smcNGRGm?p=preview
正如你可以看到它工作正常进行简单的字符串数组,而不是与邻bjects阵列
问题:
我怎么能使用标记在UI的选择与对象的数组?
可以标注在没有做多添加tagTransform功能? – 2015-01-22 21:17:07
这是值得的。是的,可以通过设置:tagging-label =“false”来完成。来源:https://github.com/angular-ui/ui-select/issues/983 – Idrees 2015-06-24 10:13:25