title: 2 ng-option, conditional options for 2nd ng-option
body: <p>So what I am trying to do is fairly simple I think. I am pretty new though to <code>ng-options</code>. I've been using ng-repeat, in the dark about <code>ng-options</code>, but I am fairly certain <code>ng-options</code> will work better for my task.</p>
  
  <p>What I am trying to do is based on the selection of whats in the first <code>ng-options</code>, will determine what the user sees in the second <code>ng-options</code>.</p>
  
  <p>Here is my HTML with my best attempt at what I am trying to do:</p>
  
  <pre><code>&lt;div class="formRow"&gt;
      &lt;select name="Client" ng-model="selectedClient" ng-options="x.Name for x in clients"&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="formRow"&gt;
      &lt;select name="Profile" ng-options="x.Name for x in profiles" ng-if="x.ID = selectedClient"&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can imagine, I have 2 objects:</p>
  
  <pre><code>$scope.clients = [{
    Name:"ClientA",
    ID:"1"
  },{
    Name:"ClientB",
    ID:"2"
  }];
  
  $scope.profiles = [{
    Name:"NORTH",
    ID:"1",
    ClientID:"1"
  },{
    Name:"SOUTH",
    ID:"2",
    ClientID:"1"
  },{
    Name:"EAST",
    ID:"3",
    ClientID:"2"
  },{
    Name:"WEST",
    ID:"4",
    ClientID:"2"
  }];
  </code></pre>
  
  <p>So, in my HTML, with the <code>ng-options</code>, what I am really trying to do logically is I want the profiles that show up in the second <code>ng-options</code> to be only whose <em>profiles.ClientID equals clients.ID</em> of the first <code>ng-options</code> that is selected.</p>
  
  <p>I am not getting any errors with what I currently have going. But with that HTML, just the Clients options are being populated.</p>
  
  <p>I hope this makes sense. Thanks!</p>