<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8" />
    <title>Angular filters FTW</title>
    <script data-require="angular.js@*" data-semver="1.3.0" src="//code.angularjs.org/1.3.0/angular.js"></script>
    <script src="script.js" type="text/javascript"></script>
  </head>

  <body ng-app="app" ng-init="things=[{id:0,name:'thing1'},{id:1,name:'thing2'},{id:2,name:'thing3'},{id:3,name:'thing4'}]">
    <select ng-model="fields.option1" ng-options="thing.name for thing in things | excludeFrom:fields.option2"></select>
    <select ng-model="fields.option2" ng-options="thing.name for thing in things | excludeFrom:fields.option1"></select>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js"></script>
    
    <pre>
      debug information:
  
      fields.option1: {{fields.option1}}
      fields.option2: {{fields.option2}}
    </pre>
  </body>

</html>
angular.module('app',[])
    .filter('excludeFrom',[function(){
      return function(array,expression,comparator){
        return array.filter(function(item){
      return !expression || !angular.equals(item,expression);
    });
  };
}])
/* Styles go here */