【发布时间】:2016-06-13 16:32:07
【问题描述】:
我正在使用ui-select 选择多个项目。当我单击要打开的选定项目之一时modal window。我将它实现为 ui-select-match 元素中的 ng-click 函数。
<ui-select id="myselect" ng-model="myvar" theme="bootstrap" ng-required="true" multiple="" search-enabled="true" reset-search-input="true">
<ui-select-match ng-click="myFunction()" placeholder="Click to select">{{$item}}
</ui-select-match>
<ui-select-choices repeat="item in ['one', 'two', 'three']">
<div>{{item}}</div>
</ui-select-choices>
</ui-select>
我的 js 是这样的:
$scope.myFunction = function() {
$uibModal.open({
template: "Hi there!"
});
}
单击时,我的模态窗口正在打开,但我遇到了问题:当我通过单击 x 图标删除项目时,模态窗口打开。我怎样才能防止这种行为?
Plunkr 在这里:http://plnkr.co/edit/i4urNAa1u1rteXhfvAyd?p=preview
【问题讨论】:
标签: css angularjs angularjs-ng-click ui-select angular-ui-select