title: Selecting default option value with knockout
body: <p>I'm trying to select a default select option based on one of the property with which I'm populating my select option. </p>
  
  <p>This code is copied straight from <a href="http://jsfiddle.net/rniemeyer/ZP79w/" rel="noreferrer">@rneimeyer's fiddle</a>. I did tweak it to do what I wanted to do. </p>
  
  <p>So, I have choices as my observableArray.</p>
  
  <pre><code>var choices = [
      { id: 1, name: "one", choice: false },
      { id: 2, name: "two", choice: true },
      { id: 3, name: "three", choice: false }
      ];
  
  function ViewModel(choices, choice) {
     this.choices = ko.observableArray(choices);
  };
  </code></pre>
  
  <p>The difference between rneimeyer's fiddle and mine is that I have <code>choice</code> property added on my object inside the observableArray instead of having a separate observable for the option that we want to be default.</p>
  
  <p>Here's the <a href="http://jsfiddle.net/shriek/ZxLV7/" rel="noreferrer">fiddle</a> on my attempt. </p>
  
  <p>Now I'm checking in my select element tag whether the <code>choice</code> attribute is true or not. And if it is then I want to set the <code>name</code> to the <code>value</code> attribute so that it becomes the default.</p>
  
  <pre><code>&lt;select data-bind="options: choices, optionsText: 'name', value: choice"&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I've tested this with <a href="http://jsfiddle.net/ybanm/" rel="noreferrer">simple data model in my fiddle</a> here as well which is working just as I wanted.</p>
  
  <p>I guess what my real query is how to check <code>choice</code> property in the data-bind. I see that <code>optionText</code> is being able to access the <code>name</code> property just fine. Not sure why it isn't same for <code>choice</code> property in <code>value</code> attribute.</p>