title: How to set the initial value of a select created using ng-options with an Object as the value in angularjs
body: <p>I have a form used to update a record populated from a restful service.</p>
  
  <p>One of the fields uses a select for a look-up value and I'm binding it to an object in my model.</p>
  
  <p>The select is created correctly and choosing options makes the correct changes to my model.</p>
  
  <p>The problem is when I initially load the page the select is blank.</p>
  
  <p>Is there a way to set the initial value correctly without having to crawl the look-up object and match the id to get the auto-generated index position?</p>
  
  <p>Or better yet, set the value to be the object instead of an auto-generated index.</p>
  
  <pre><code>&lt;div ng-controller="MyCtrl"&gt;
      Id: &lt;input ng-model="course.id" readonly&gt;&lt;br&gt;
      Cost: &lt;input ng-model="course.cost" ng-required="true"&gt;&lt;br&gt;
      Title: &lt;select ng-model="course.courseTitle" ng-options="title.name for title in courseTitles"&gt;
        &lt;/select&gt; {{course.courseTitle.description}}&lt;br&gt;
      Length: &lt;input ng-model="course.length" ng-required="true"&gt;&lt;br&gt;
      &lt;br&gt;
      Id: {{course.id}}&lt;br&gt;
      Cost: {{course.cost}}&lt;br&gt;
      Title: {{course.courseTitle.name}}&lt;br&gt;
      Length: {{course.length}}
  &lt;/div&gt;
  
  function MyCtrl($scope) {
      $scope.course = {
          "id": "108",
          "cost": "155",
          "courseTitle": {
              "description": "Description of course 37.",
              "id": "37",
              "name": "Course 37 Name"
          },
          "length": "7"
      };
  
      $scope.courseTitles = [{
          "description": "Description of course 37.",
          "id": "37",
          "name": "Course 37 Name"},
      {
          "description": "Description of course 63.",
          "id": "67",
          "name": "Course 63 Name"},
      {
          "description": "Description of course 88.",
          "id": "88",
          "name": "Course 88 Name"}];
  
  }
  </code></pre>
  
  <p>I have created a fiddle here - <a href="http://jsfiddle.net/bcarter/Jxydp/" rel="nofollow">http://jsfiddle.net/bcarter/Jxydp/</a></p>