title: Knockout js checkbox checked binding
body: <p>In knockout js am trying to perform a foreach on an array of data to display check boxes. The issue I am having is that the checked databind does not appear to run until I interact with one of the boxes. For example, below I am generating 5 text boxes none of which are showing up as checked. However when I click "one", "two" and "four" also get checked as they should have been from the beginning.</p>
  
  <p>Javascript:</p>
  
  <pre><code>var viewModel = {};
  
  viewModel.choices = ["one", "two", "three", "four", "five"];
  viewModel.selectedChoices = ko.observableArray(["two", "four"]);
  
  viewModel.selectedChoicesDelimited = ko.dependentObservable(function () {
          return viewModel.selectedChoices().join(",");
      });
  
  ko.applyBindings(viewModel);
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;ul class="options" data-bind="foreach: choices"&gt;
      &lt;li&gt;&lt;label&gt;&lt;input type="checkbox" name="NotifyMembers" data-bind="checked: $parent.selectedChoices, attr: { value: $data }" /&gt;&lt;span data-bind="text: $data"&gt;&lt;/span&gt;&lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;hr /&gt;
  &lt;div data-bind="text: selectedChoicesDelimited"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Fiddle is at: <a href="http://jsfiddle.net/bvGG3/1/" rel="nofollow">http://jsfiddle.net/bvGG3/1/</a></p>
  
  <p>Thanks for your help.</p>