title: Use Knockout 'submit' binding with child view model and inherited callback method
body: <p>I'm trying to solve the following problem using Knockout JS</p>
  
  <ul>
  <li>Need to bind a HTML form via "submit" binding to a child view model</li>
  <li>The call back method bound to "submit" is an inherited method</li>
  </ul>
  
  <p>The following code will explain the above scenario better. The same can be found in <a href="http://jsfiddle.net/omegasilva/j6Brv/1/" rel="nofollow">this fiddle</a>.</p>
  
  <pre><code>function MasterViewModel() {
      var self = this;
      self.employeeViewModel = new EmployeeViewModel();
  };
  
  function EmployeeViewModel () {
      var self = this;
      self.empFirstName = ko.observable();
      self.empLastName = ko.observable();
      self.employeeList = ko.observableArray([]);
  };
  
  EmployeeViewModel.prototype.addEmployee = function () {
      var self = this;
      self.employeeList.push(new Employee(self.empFirstName(), self.empLastName()));
  }
  
  function Employee(firstNameParam, lastNameParam) {
      var self = this;
      self.firstName = ko.observable(firstNameParam);
      self.lastName = ko.observable(lastNameParam);
  }
  
  ko.applyBindings(new MasterViewModel());
  </code></pre>
  
  <p>In HTML, I use the submit binding as shown below;</p>
  
  <pre><code>&lt;form data-bind="submit: employeeViewModel.addEmployee"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I've observed that always, the "this" context passed for the callback method is an instance of "MasterViewModel". I searched for a method of passing a different context with the "submit" binding, but in vain.</p>
  
  <p>Is this a limitation that I'm trying to exploit, of is there a workaround?</p>
  
  <p>Thanks.</p>