title: AngularJS drop down - auto select not working
body: <p><strong>In controller</strong> </p>
  
  <pre><code>$scope.persons = [{"id": 1, "name": "Diso"}, {"id": 2, "name": "Tatalop"}];
  </code></pre>
  
  <p><strong>In create page</strong> I have this codes.</p>
  
  <pre><code>&lt;select name="person" ng-options="person.id as person.name for person in persons" ng-model="job.person_id"&gt;
      &lt;option value=""&gt;Select a Person&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The above drop down will display the person <code>name</code> and its value will be person <code>id</code>. If I submit the form then I am getting person <code>id</code> properly. Which is working perfectly. 
  <br/><br/>
  <strong>In update page</strong> I want to use the same code (same controller and same html file). Auto select is required now for this drop down. Suppose when page loads drop down should select the 2nd person automatically. To make it successful I have written <code>$scope.job.person_id = $scope.persons[1];</code> in the controller.</p>
  
  <p>Now the problem is if I remove <code>person.id as</code> from <code>ng-options</code> then only the auto select functionality works otherwise it doesn't work. Now if I remove <code>person_id as</code> then I get the whole object(<code>{"id": 2, "name": "Tatalop"}</code>) as the result of drop down. But I want only the person <code>id</code>.</p>
  
  <p>How to do that? Am I missing something? Can any one please suggest me ?</p>