title: Selected for select option menu if condition is met in AngularJS
body: <pre><code>&lt;select ng-model="item.value" ng-options="item.name for item in items"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The above will populate select option in AngularJS, but how can I add <code>selected</code> if my condition is met?</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>&lt;select ng-model="item.value" ng-options="item.name for item in items" if="item.name == someValueToCheckAgainst" selected endif&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Obviously the above is wrong, but I was trying to search for this to see if it is possible to do.</p>
  
  <p>This is items</p>
  
  <pre><code>var items = [ 'a', 'b', 'c' ];
  var someValueToCheckAgainst = 'b';
  </code></pre>
  
  <p>so my menu should be like this</p>
  
  <pre><code>&lt;select ng-model="item.value"&gt;
    &lt;option value="a"&gt;a&lt;/option&gt;
    &lt;option value="b" selected&gt;a&lt;/option&gt;
    &lt;option value="c"&gt;a&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>