I'm trying to inherit functionality from a parent view model to a child view model like so:
function ParentVM() {
var self = this;
self.MyFunc = function () {
console.log(self.SomeVar); // this logs "undefined"
}
}
function ChildVM() {
var self = this;
ko.utils.extend(self, new ParentVM());
self.SomeVar = "hello";
}
However, when MyFunc is called, SomeVar is undefined.