title: Knockout not updating view, when a template binds a handler using $data
body: <p>I'm trying to write my KO templates in a certain manner, and it seems to be causing issues with Knockout, which stops updating the view. I wish to avoid too many explicit dependencies in my views as possible, so when I'm writing a template for adding to an files attachments list, I thought I could make use of the <code>$data</code> variable:</p>
  
  <pre><code>&lt;script id="attachments-template" type="text/html"&gt;
      &lt;input type="button" data-bind="attachments: $data" value="add"&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>And the template binding: </p>
  
  <pre><code>&lt;div data-bind="template: {name: 'button-add-data', data: attachments}"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This keeps the actual property mapped in the usage site, instead of off in random templates. The <code>attachments</code> binding handler in my actual case wraps the jQuery fileupload plugin, but just calling <code>push(i++)</code> shows the issue anyway.</p>
  
  <pre><code>var i = 0;
  ko.bindingHandlers.attachments = {
      init: function(element, valueAccessor) {
          var files = valueAccessor();
          $(element).click(function() {
              files.push(i++);
          });
      }
  };
  
  var list = ko.observableArray();
  var model= {
      attachments: list
  };
  </code></pre>
  
  <p>A fiddle which shows this, using KO 2.2.0: <a href="http://jsfiddle.net/stofte/sWGkJ/">http://jsfiddle.net/stofte/sWGkJ/</a> The fiddle also shows that binding against an explicit property works fine.</p>
  
  <p>Obviously there's alot of stuff on Google and SO on KO and binding contexts, but I can't find anything on the usage of $data in binding handlers, I'm not sure what KO law I'm breaking with my usage of $data, but seems like it would make good sense to be able to do what I want?</p>