Question

I am using ui-select2.

I have a dropdown that has the options generated from an ng-repeat. I want to be able to click a button to remove the currently selected item from the array of items. that change is not reflection in the ui-select2 UI.

Do I have to reload ui-select2 on the element or something of that nature?

Here is a Plunker of what I want to do.

http://plnkr.co/edit/9g6zBHucyDX4nAnWQtc4?p=preview

Thanks

Was it helpful?

Solution

Well, until somebody comes up with a neat solution, playing a bit with your plunker has yield this:

$scope.items = $scope.items.slice(1, $scope.items.length);

Check out this forked plunker.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top