title: auto-populate select list with a one to several relationship in AngularJS
body: <p>So I started with a need for a simple auto populate form field. As a user selects a drop down menu item, another field is automatically populated. Now I need to auto-populate <em>another</em> field, this time another select list with two choices each for each previous selection.</p>
  
  <p>This is how it works:</p>
  
  <p>source system selected - other source systems pre-populated with value. I did this using this method:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form name="intakeform"&gt;
           &lt;div class="form-group"&gt;
              &lt;label for="sourceSystem"&gt;Source System&lt;/label&gt;
             &lt;select class="form-control" ng-model="system" ng-options="s.name for s in systems" &gt;
                  &lt;option value=""&gt;Select Source System&lt;/option&gt;
             &lt;/select&gt;   
          &lt;/div&gt;
         &lt;div class="form-group"&gt;
              &lt;label for="otherSystem"&gt;Other Source System Indentifiers&lt;/label&gt;
              &lt;input type="text" ng-model="system.ossi" class="form-control" placeholder="Other Source System Indentifiers"&gt;
          &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>app.js controller:</p>
  
  <pre><code>routerApp.controller('IntakeController', function($scope, $timeout){
   $scope.systems = [{
      name: 'Cosmos',
      ossi: 'Cosmos DIV',
    },
    {
      name: 'UNET',
      ossi: 'ADJ and ENG',
    },
  ];
  });
  </code></pre>
  
  <p>This allowed a nice 1:1 relationship. If I chose one system, the other system was automatically selected. Now I have to have another select list based on the source system selection. This means I'm going to have a two item select list for each of the source systems - resulting in a 2:1 relationship.</p>
  
  <p>How would I do this in Angular then? I've tried the ng-show, ng-hide and I'm not sure I can do this with the ng-options either in my current set up. This are static lists, and won't be dynamic if that helps. There are tons of examples of having one list show after one item is selected in another list, but I can't seem to find an example where someone had several items in a drop down list that was dependent on the initial selection.</p>
  
  <p>any help is appreciated</p>
  
  <p>P</p>