title: knockout foreach dosn't work for model
body: <p>Hello I have next code:</p>
  
  <pre><code> &lt;div class="dropdownSelector" data-bind="visible: modelSelectorD.isActive()"&gt;
      &lt;i&gt;&lt;/i&gt;
      &lt;input type="text" data-bind="value: modelSelectorD.searchText, valueUpdate: 'afterkeydown'" class="txt block searchField" /&gt;
      &lt;ul data-bind="foreach: modelSelectorD.visibleData"&gt;
          &lt;li data-bind="click: modelSelectorD.doSwitch"&gt;&lt;a data-bind="html: modelSelectorD.getName($data,$element)"&gt;&lt;/a&gt;&lt;/li&gt;        
      &lt;/ul&gt;
      &lt;span data-bind="visible:modelSelectorD.showMoreLink, text:modelSelectorD.showMoreText"&gt;&lt;/span&gt;&lt;br/&gt;    
      &lt;a href="#" class="close" data-bind="click: modelSelectorD.close"&gt;Close&lt;/a&gt;
  &lt;/div&gt;
  
  
  &lt;div class="dropdownSelector" data-bind="visible: modelSelectorC.isActive()"&gt;
      &lt;i&gt;&lt;/i&gt;
      &lt;input type="text" data-bind="value: modelSelectorC.searchText, valueUpdate: 'afterkeydown'" class="txt block searchField" /&gt;
      &lt;ul data-bind="foreach: modelSelectorC.visibleData"&gt;
          &lt;li data-bind="click: modelSelectorC.doSwitch"&gt;&lt;a data-bind="html: modelSelectorC.getName($data,$element)"&gt;&lt;/a&gt;&lt;/li&gt;        
      &lt;/ul&gt;
      &lt;span data-bind="visible:modelSelectorC.showMoreLink, text:modelSelectorC.showMoreText"&gt;&lt;/span&gt;&lt;br/&gt;    
      &lt;a href="#" class="close" data-bind="click: modelSelectorC.close"&gt;Close&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      var obj = { id: 0, name: "not selected" };
      function selector(maxcount, serviceGet, serviceChange) {
          var self = this;
          self.isActive = ko.observable(false);
          self.maxcount = ko.observable(maxcount);
          self.serviceUrlGet = serviceGet;
          self.serviceUrlChange = serviceChange;
          self.searchText = ko.observable("");
          self.selectedItem = ko.observable(obj);
          self.allObjects = ko.observableArray([]);
          self.visibleData = ko.observableArray([]);
          self.showMoreLink = ko.computed(function () {
              return self.allObjects().length &gt; self.maxcount();
          }
          );
  
          self.showMoreText = ko.computed(function () {
              return "... ( " + self.allObjects().length + " )";
          }
          );
  
          self.getName = function (data, element) {
              if (data) {
                  var html = "&lt;i&gt;" + data.id + "&lt;/i&gt; " + data.name;
                  return html;
              }
              return "";
          };
          self.doSwitch = function (data) {
              self.selectedItem(data);
              self.close();
          };
  
          self.close = function () {
              self.isActive(false);
          };
  
          self.show = function () {
              self.isActive(true);
          };
  
          self.searchText.subscribe(function (newValue) {
              self.getData(newValue);
          });
  
          self.getData = function (searchText) {
              var data = { "name": searchText, "maxcount": self.maxcount() };
              $.ajax({
                  type: "POST",
                  url:  self.serviceUrlGet,
                  cache: false,
                  contentType: 'application/json',
                  dataType: "json",
                  data: JSON.stringify(data),
                  success: function (data) {
                      self.allObjects(data.d);
                      if (self.allObjects().length &gt; self.maxcount()) {
                          self.visibleData(self.allObjects().slice(0, self.maxcount()));
                      }
                      else {
                          self.visibleData(self.allObjects());
                      }
                  },
                  error: function (jqXHR, textStatus, errorThrown) {
                      //console.log(textStatus);
                  }
              });
          }
      }
      var modelSelectorD = new selector(5, "/services2", "");
      var modelSelectorC = new selector(5, "/services1", "");
      ko.applyBindings(modelSelectorD);
      ko.applyBindings(modelSelectorC);
      $(function () {
          modelSelectorD.getData("");
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>it is working well except foreach, foreach dosn't show me my LI elements. Why dos't it happens ? </p>