title: AngularJS dropdown not showing selected value
body: <p>Am facing problem in displaying selected value in angular dropdown.
  it works when i give like this</p>
  
  <pre><code>$scope.selectedItem = $scope.items[1];
  </code></pre>
  
  <p>not working, if i give directly that value </p>
  
  <pre><code>$scope.selectedItem = { name: 'two', age: 27 };
  </code></pre>
  
  <p><strong>HTML</strong>:</p>
  
  <pre><code>&lt;html ng-app="app"&gt;
    &lt;body&gt;
      &lt;div ng-controller="Test"&gt;
        &lt;select ng-model="selectedItem" ng-options="item.name for item in items"&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>JS</strong>:</p>
  
  <pre><code>var app = angular.module('app',[]);
  app.controller('Test',function($scope){
     $scope.items = [{name: 'one', age: 30 },{ name: 'two', age: 27 },{ name: 'three', age: 50 }];
    $scope.selectedItem = $scope.items[1];
  });
  </code></pre>
  
  <p><strong>CODEPEN:</strong>
  <a href="http://codepen.io/anon/pen/zxXpmR" rel="noreferrer">http://codepen.io/anon/pen/zxXpmR</a></p>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>Thank you samir-das. I fixed as per your suggestion. </p>
  
  <pre><code>var choosen_value = { name: 'two', age: 27 };
  angular.forEach($scope.items, function(item){
    if(angular.equals(choosen_value, item)){
      $scope.selectedItem = item;
    }
  });
  </code></pre>