title: Angular Nested Select filter by first select
body: <p>Please help me, how to use 2 JSON feed for nested select in angular</p>
  
  <p>Manager JSON Table:</p>
  
  <ul>
  <li>manager_id </li>
  <li>manager_name</li>
  </ul>
  
  <p>Project JSON Table:</p>
  
  <ul>
  <li>project_id </li>
  <li>project_name</li>
  <li>manager_id</li>
  </ul>
  
  <p>If you have any example please let me know :D</p>
  
  <p><a href="https://jsfiddle.net/pu3jo4r1/" rel="nofollow noreferrer">https://jsfiddle.net/pu3jo4r1/</a></p>
  
  <p>HTML:</p>
  
  <pre><code>            &lt;!-- input manager_id --&gt;
          &lt;label ng-controller="SelectProjectManager as ctrl" class="item item-input item-select noborder"&gt;
                          &lt;span class="input-label"&gt;Manager&lt;/span&gt;
                          &lt;select id="managers" ng-model="ctrl.selectedManager" ng-options="i.manager_name for i in ctrl.managers" ng-change="ctrl.managerChanged()"&gt;
                                          &lt;option value=""&gt;Select&lt;/option&gt;
                          &lt;/select&gt;
          &lt;/label&gt;
          &lt;!-- ./input manager_id --&gt;
  
          &lt;!-- input project_id --&gt;
          &lt;label ng-controller="SelectProjectManager as ctrl" class="item item-input item-select noborder"&gt;
                          &lt;span class="input-label"&gt;Project&lt;/span&gt;
                          &lt;select id="projects" ng-model="ctrl.selectedProject" ng-options="i.project_name for i in ctrl.projects"&gt;
                                          &lt;option value=""&gt;Select&lt;/option&gt;
                          &lt;/select&gt;
          &lt;/label&gt;
          &lt;!-- ./input project_id --&gt;
  </code></pre>
  
  <p>JS Controller:</p>
  
  <pre><code>.controller('SelectProjectManager', function($http) {
  // results are stored in these 2 variables
  this.selectedManager;
  this.selectedProject;
  
  var that = this;
  
  $http({
    url: 'https://ima.baguscloud.com/voezie/rest-api.php?json=manager',
    method: 'GET',
    dataType: 'json', 
    data: '',         
    headers: {
      'Content-Type': 'application/json'
    }
  }).success(function (data, status, headers, config) {
    that.managers = data;
  });
  
  this.managerChanged = function() {
    $http({
      url: 'https://ima.baguscloud.com/voezie/rest-api.php?json=project',
      method: 'GET',
      dataType: 'json', 
      data: '',         
      headers: {
        'Content-Type': 'application/json'
      }
    }).success(function (data, status, headers, config) {
      that.projects = data;
    });
  };
  </code></pre>
  
  <p>});</p>