JS:
function Child() {
this.method = function() {
console.dir(this); // 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() {
this.child = new Child();
}
var p = new Parent();
ko.applyBindings(p);
HTML:
<a href="#" data-bind="click: child.method">foo</a>
Is it bug or a feature I just not understand?