JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" data-bind="click: child.method">foo</a>
JavaScript
function Child() {
var self = this;
self.method = function() {
console.dir(self); // this should be 'p.child' <Child> since
//'method' called as a property of 'p.child'
// but when you call it from KO it's actually 'p' <Parent>
};
}
function Parent() {
var self = this;
self.child = new Child();
}
var p = new Parent();
ko.applyBindings(p);