I'm selecting multiple items with ui-select. When I click on one of the selected items I want to open modal window. I implemented it just as the function on ng-click in the ui-select-match element.
<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>
my js looks like that:
$scope.myFunction = function() {
$uibModal.open({
template: "Hi there!"
});
}
On click my modal window is opening, but I have the problem: the modal windows opens when I remove the item by clicking on the x
icon. How can I prevent this behaviour?
Plunkr is here: http://plnkr.co/edit/i4urNAa1u1rteXhfvAyd?p=preview