如果删除了选定项目中的非最后一项,则Ui-select会删除两个标签

时间:2018-08-21 11:39:31

标签: javascript angularjs ui-select

我正在使用ui-select(https://github.com/angular-ui/ui-select),当我单击十字按钮以删除选定的项目时,如果该项目不是要删除的最后一个项目,它将删除两个项目。但是,当我刷新页面时,被删除的额外价值又回来了。如果删除的项目是所选项目中的最后一个项目,则效果很好。以下是我的代码:

<ui-select multiple tagging="tagTransform" ng-model="tag.tags"
                                       theme="bootstrap" on-remove="removeCreativeTag($item, tag.uuid, 'image_tag')" on-select="selectTag($item, tag.uuid, 'image_tag')"
                                       ng-disabled="ctrl.disabled" close-on-select="false" style="width: 90%; height: 100%; background-color: #ffffff; border: none;  box-shadow: none;" placeholder="+ Click to add a new tag" title="+ Click to add a new tag">
                                <ui-select-match>{{$item.tag}}</ui-select-match>
                                <ui-select-choices repeat="tagname in allTags | filter:$select.search">
                                    {{ tagname.tag }}
                                </ui-select-choices>
                            </ui-select>

0 个答案:

没有答案