title: Knockout goes crazy when I applyBindings twice with dynamic html
body: <p>I am creating a single page application with knockout ...</p>
  
  <p>I have a GlobalViewModel to admin all dynamic pages (I get the html via ajax).</p>
  
  <p>Here is an example of my problem: </p>
  
  <p><a href="http://jsfiddle.net/zWtrr/7/" rel="nofollow">http://jsfiddle.net/zWtrr/7/</a></p>
  
  <p>When I load 2 times the same template (click 2 times in "show template") knockouts goes crazy and duplicate data... if you check the observable Array, there's no duplicated data.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;button data-bind="click: showView"&gt;show template&lt;/button&gt;
      &lt;div data-bind="html: templateHtml"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>function GlobalViewModel(){
      var self = this;
      self.templateHtml = ko.observable();
      self.templateVM = ko.observable();
  
      self.showView = function(){
          //i get this html from ajax
          var pageHtml = "&lt;div id='template' data-bind='with: templateVM'&gt;"+
              "&lt;button data-bind='click: showAll'&gt;All&lt;/button&gt;" +
              "&lt;button data-bind='click: showNames'&gt;Names&lt;/button&gt;" + 
              "&lt;button data-bind='click: showLastNames'&gt;LastNames&lt;/button&gt;" +
              "&lt;button data-bind='click: showNickNames'&gt;NickNames&lt;/button&gt;" +
              "&lt;ul data-bind='foreach: resultsToShow'&gt;" +
              "    &lt;li data-bind='text: $data'&gt;&lt;/li&gt;" +
              "&lt;/ul&gt;" +
              "&lt;/div&gt;";
          self.templateHtml(pageHtml)
          self.templateVM(new ViewModel())
          ko.cleanNode(document.getElementById("template"))
          ko.applyBindings(window.gvm, document.getElementById("template"));
      }
  
  }
  function ViewModel(){
      var self = this;
      self.selected = ko.observable("All");
      self.resultsToShow = ko.observableArray([]);
      self.result1 = ["Facu", "Feli", "Juli"];
      self.result2 = ["Perez","Gonzales","Garcia"];
      self.result3 = ["Piti", "Tito", "Gato"];
  
      self.showAll = function (){
          self.resultsToShow(self.result1.concat(self.result2,self.result3));
          self.selected("All");
      }
  
      self.showNames = function (){
          self.resultsToShow(self.result1);
          self.selected("Names");
      }
  
      self.showLastNames = function (){
          self.resultsToShow(self.result2);
          self.selected("LastNames");
      }
  
      self.showNickNames = function (){
          self.resultsToShow(self.result3);
          self.selected("NickNames");
      }
      self.showAll();
  }
  window.gvm = new GlobalViewModel();
  ko.applyBindings(window.gvm, document.getElementById("container"));
  </code></pre>