title: How knockout know about data-binded object if it has only its name?
body: <p>I have something like:</p>
  
  <pre><code>&lt;form action='/someServerSideHandler'&gt;
    &lt;p&gt;You have asked for &lt;span data-bind='text: gifts().length'&gt;&amp;nbsp;&lt;/span&gt; gift(s)&lt;/p&gt;
    &lt;table data-bind='visible: gifts().length &gt; 0'&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;Gift name&lt;/th&gt;
          &lt;th&gt;Price&lt;/th&gt;
          &lt;th /&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody data-bind='foreach: gifts'&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;input class='required' data-bind='value: name, uniqueName: true' /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input class='required number' data-bind='value: price, uniqueName: true' /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a href='#' data-bind='click: $root.removeGift'&gt;Delete&lt;/a&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  
    &lt;button data-bind='click: addGift'&gt;Add Gift&lt;/button&gt;
    &lt;button data-bind='enable: gifts().length &gt; 0' type='submit'&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var GiftModel = function(gifts) {
  var self = this;
  self.gifts = ko.observableArray(gifts);
  
  self.addGift = function() {
    self.gifts.push({
      name: "",
      price: ""
    });
  };
  
  self.removeGift = function(gift) {
    self.gifts.remove(gift);
  };
  
  self.save = function(form) {
    alert("Could now transmit to server: " + ko.utils.stringifyJson(self.gifts));
    // To actually transmit to server as a regular form post, write this: ko.utils.postJson($("form")[0], self.gifts);
  };
  };
  
  var viewModel = new GiftModel([
      { name: "Tall Hat", price: "39.95"},
      { name: "Long Cloak", price: "120.00"}
  ]);
  ko.applyBindings(viewModel);
  
  // Activate jQuery Validation
  $("form").validate({ submitHandler: viewModel.save });
  </code></pre>
  
  <p>how it is happening that <code>ko.applyBindings(viewModel);</code> is magically making biding by name of variable? Is knockout searching it somehow by name? How the template know that this is his array/data set? I am basically .net developer so in my mind taking something "by name" is not clear. Or maybe am I wrong that this is taken by name? I read documentation but I still do not get the way how knockout connect template gifts() with array named gifts from model?</p>
  
  <p>but the way this is sample from knockout main page. </p>
  
  <p><a href="http://knockoutjs.com/examples/gridEditor.html" rel="nofollow">http://knockoutjs.com/examples/gridEditor.html</a></p>