angularjs select a drop down option on button click
<p>I have a form in which there are many fields. This form is under Angular Controller, say Parent. This form has a drop down that is populated using Angular Controller, say Child. There is an <strong>Add</strong> button to this form on click of which all the details are stored in the DB. These added values are displayed as a row in a table below the form in the same page.</p>

<p>Each row of this table has <strong>Edit</strong> button. On click of this edit button, the values should be populated in the form above in it's respective fields. I am able to get populated all values except the drop down. I have the ng-model used for the drop down in form, set with appropriate values on click of <strong>Edit</strong> Button. When I click on edit, drop down options are not selected though its model object is set correctly. It still displays the first default option.</p>

<p>How do I get the drop down option selected?</p>

<p><strong>PN: On debugging the console, I see the hashkey of dropdown values different from the one retrieved from the table row.</strong></p>

<p><strong>My HTML Code for Form:</strong></p>

<pre><code>&lt;div class="col-sm-8" ng-controller="ConstantsController" ng-init="listDocumentSectionTypeConstants()"&gt;
  &lt;select class="form-control" id="section-type-list" name="section_type_list" ng-options="sectionType.description for sectionType in sectionTypes"
                                        ng-model="ctrl.comment.documentSectionTypeConstant" ng-change="$parent.setSection()" required&gt;
    &lt;option value=""&gt; -- Please Select a Section --&lt;/option&gt;
  &lt;/select&gt;
&lt;/div&gt;
</code></pre>

<p><strong>My HTML Code for Button:</strong></p>

<pre><code>&lt;button class="btn btn-primary btn-xs" ng-click="editComment(comment)" data-toggle="tooltip" title="Edit Comment" data-placement="bottom"&gt;&lt;/button&gt;
</code></pre>

<p><strong>My Angular Controller</strong></p>

<pre><code>$scope.editComment = function (comm) {        
        self.comment.documentSectionTypeConstant = comm.documentSectionTypeConstant;        
  }
</code></pre>

<p><strong>Note that there is no issue in add, update or delete operation.</strong></p>

<p><strong>EDIT</strong> <em>(To include Data JSON)</em> </p>

<p><strong>On selecting a dropdown:</strong></p>

<pre><code>Object {
     id: "DST_FOREWORD", 
     active: 0, 
     defaultSelection: false, 
       description: "Foreword", 
         showInUi: true…}
$$hashKey:"object:36"
accountNonExpired:true
accountNonLocked:true
active:0
credentialsNonExpired:true
defaultSelection:false
description:"Foreword"
enabled:true
id:"DST_FOREWORD"
showInUi:true
sortSequence:null
username:null
</code></pre>

<p><strong>On Click of Edit Button</strong> <em>(Added Dropdown Value)</em></p>

<pre><code>Object {$$hashKey: "object:57", id: "DST_FOREWORD", description: "Foreword"}
$$hashKey:"object:57"
description:"Foreword"
id:"DST_FOREWORD"
</code></pre>

<p>Note that the hashkey are different in both the cases. Not sure if that is what the cause is.</p>

<p><strong>Edit 2</strong></p>

<p><a href="http://i.stack.imgur.com/DakBi.png" rel="nofollow">My Screen</a></p>