title: Knockout nested view model
body: <p>I'm stuck with what must be a simple fix. I am using knockout.js with nested view models, and all seems fine except that my remove function is not working correctly. It appears to be binding correctly, however it is not fired when I click remove. </p>
  
  <p>Why nested view models? Long story, but essentially a lot of stuff is required to be on one page!</p>
  
  <p>So here is the code:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;section class="mini-form-container"&gt;
      &lt;form data-bind="submit: repeatGuest.addDate"&gt;
          &lt;input type="date" data-bind="value: repeatGuest.previousStay"/&gt;
          &lt;button type="submit" class="button-secondary "&gt;Add date&lt;/button&gt;
      &lt;/form&gt;
      &lt;div data-bind="foreach: repeatGuest.dates, visible: repeatGuest.dates().length &gt; 0"&gt;
          &lt;div&gt;
              &lt;input data-bind="value: date" disabled="disabled"  /&gt;
              &lt;a data-bind="click: $parent.removeDate"&gt;Remove&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section&gt;
      &lt;div data-bind="text: ko.toJSON($data)"&gt;&lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>function RepeatGuest() {
      /// &lt;summary&gt;Child View Model&lt;/summary&gt;
      this.dates = ko.observableArray();
      this.previousStay = ko.observable();
  }
  
  RepeatGuest.prototype.addDate = function () {
          var self = this.repeatGuest;
          if (self.previousStay()) {
              self.dates.push({
                  date: self.previousStay()
              });
          }
      };
  
  RepeatGuest.prototype.removeDate = function (date) {
      this.dates.remove(date);
  }
  
  function ViewModel() {
      var self = this;
      self.repeatGuest = new RepeatGuest();
  }
  ko.applyBindings(new ViewModel());
  </code></pre>
  
  <p>And here is my fiddle: <a href="http://jsfiddle.net/6Px4M/2/" rel="noreferrer">http://jsfiddle.net/6Px4M/2/</a></p>
  
  <p>So why isn't my remove function getting fired?</p>
  
  <p><em>Possible side question: is nested view models the wrong path to take in knockout, there doesn't seem to much info on this?</em></p>