0

In knockout, I am using ko.cleanNode($("#aDivInPartialView")[0]) to clean a node before applying binding second/multiple times because of change in view model occurred by drop down changes. My question is why do I have to pass this index value and what is the significance of it?

Mamun Reza
  • 608
  • 1
  • 6
  • 19

1 Answers1

0

ko.cleanNode is for internal use. Apart from that, the importance of the index is related to what $element is. Although there is such a special variable, it is used in the HTML, not in the JS. Most likely in your code it is the result of a jQuery selector, which returns a nodelist, and you want the first retrieved item.

Community
  • 1
  • 1
Roy J
  • 42,522
  • 10
  • 78
  • 102