There is a flaw in the selection, which does not include what is currently selected. I will include a mistake in the solution so that you can see it.
ng-options is what you need. Here is an example using 2 separate selections.
<select ng-model='selectedCountry' ng-options='country.name for country in countries'></select> <select ng-model='selectedCountry' ng-options='country.name for country in filteredCountries()'></select>
Here are snippets of $scope . Note that filterCountries simply returns countries, minus the selected country.
$scope.countries = [{name:'United States'},{name:'United Kingdom'},{name:'Canada'}]; $scope.filteredCountries = function(){ var filteredCountries = []; angular.forEach($scope.countries, function(val, key){ if(val !== $scope.selectedCountry){ this.push(val); } },filteredCountries); return filteredCountries; };
The error you will notice is that as soon as you select the second, it will not display your selected value, since it is immediately filtered out of the parameters. This is not the best user interface.
Working example: http://plnkr.co/edit/cRBdkE3akCeBXYqfyHFO
Update: Since you cannot use ng-options with the AngularUI Select2 directive, here is plunkr with example 2: http://plnkr.co/edit/Hmt1OXYvtHOAZPzW7YK3?p=preview
Also, instead of the filterCountries function, as indicated above, watch will be more efficient. It will only run code when it detects a change in the observed value.
$scope.$watch('version1model',function(){ $scope.filteredItems = []; angular.forEach($scope.items, function(val, key){ if(val.id != $scope.version1model){ this.push(val); } },$scope.filteredItems); });