title: Forward a modified valueAccessor to ko.bindingHandlers.with
body: <pre><code>ko.bindingHandlers.editMode =
  {
      update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext)
      {
          var newValueAccessor = ko.utils.unwrapObservable(valueAccessor());
          var $element = $(element);
          var viewModel = new someViewModel();
          $element.append("&lt;input type='text' data-bind='value: model.value' /&gt;");
          ko.bindingHandlers.with.update(element, function() { return viewModel }, allBindingsAccessor, viewModel, bindingContext);
      }    
  }
  </code></pre>
  
  <p>someViewModel is a view model that contains the <code>model.value</code> property (observable) that I want to bind to the appended input. But when calling update for the <code>with</code> binding I get <code>Uncaught TypeError: Cannot read property 'savedNodes' of undefined.</code> (knockout.js debug build). How should I pass the <code>viewModel</code> to <code>with.update</code> so that it get the same result like when using <code>data-bind="with: new someViewModel()"</code>?
  Thanks!</p>