title: Dropdown with multiple models
body: <p>I'm having trouble figuring out how to select the appropriate value in a dropdown based on multiple model attributes.  I am trying to achieve a dropdown with 3 options: <code>Present, Absent, Make-up</code>.  </p>
  
  <p>The catch is, the absent attribute stores whether a person was absent (<code>true/false</code>), and the makeup attribute stores whether it was a make-up(IE a user was making up a class, so he was <code>absent: false</code> and <code>makeup: true</code>. For example, say I have the following model:</p>
  
  <pre><code>users : {
    1 : {
      absent: true
      makeup: false
    },
    2 : {
      absent: false
      makeup: true
    }
  }
  </code></pre>
  
  <p>and then a dropdown with the following options:</p>
  
  <pre><code>options : {
     false : 'Present'
     true : 'Absent'
     'makeup' : 'Make-Up'
  }
  </code></pre>
  
  <p>I know how to bind the correct values to the model based on the selection, via ng-change.  However, I'm having trouble displaying the initial value in the dropdown, since the value is dependent upon multiple model attributes:</p>
  
  <pre><code>// options shown in full instead of ng-options for demo purposes here
  &lt;select ng-model="user.absent"&gt;
      &lt;option value="false"&gt;Present&lt;/option&gt;
      &lt;option value="true"&gt;Absent&lt;/option&gt;
      &lt;option value="makeup"&gt;Make-up&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>This is driving me up a wall! Any help is appreciated!</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is the best solution I could come up with.  It's a bit ugly, but it works  I'm still looking for a more proper solution, if anyone has one.</p>
  
  <pre><code>&lt;select ng-model="userAttendance.status" ng-change="changeAttendance(userAttendance)"&gt;
       &lt;option value="false" ng-selected="userAttendance.makeup == false &amp;&amp; userAttendance.absent == false"&gt;Present&lt;/option&gt;
       &lt;option value="true" ng-selected="userAttendance.absent == true"&gt;Absent&lt;/option&gt;
       &lt;option value="makeup" ng-selected="userAttendance.makeup == true &amp;&amp; userAttendance.absent == false"&gt;Make-up&lt;/option&gt;
  &lt;/select&gt;
  
  //controller
  $scope.changeAttendance = function(userAttendance) {
      if (userAttendance.status == 'makeup') {
         userAttendance.makeup = true;
         userAttendance.absent = false;
      } else {
         userAttendance.absent = userAttendance.status;
         userAttendance.makeup = false;
      }
  };
  </code></pre>