Skip to content

Instantly share code, notes, and snippets.

@pbouzakis
Created August 5, 2014 17:38
Show Gist options
  • Save pbouzakis/7efcfd06bcc9b4d98481 to your computer and use it in GitHub Desktop.
Save pbouzakis/7efcfd06bcc9b4d98481 to your computer and use it in GitHub Desktop.
Monkey patching `applyBindingsToDescendants` to support insertion points.
ko.applyBindingsToDescendants = (function (original) {
return function (childBindingContext, element) {
var insertionNodes = ko.utils.domData.get(element, "insertionNodes");
original.apply(ko, arguments);
if (insertionNodes) {
transcludeInto(element, insertionNodes);
}
};
})(ko.applyBindingsToDescendants);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment