TypeScript and Knockout: Define Computed Observables
ko.computed() in TypeScript On my second day of figuring out how to use knockout.js and TypeScript, I came upon computed observables and ran into trouble. As a point of reference, this is a simplified version of how I declared my ViewModel in pure JavaScript: var SampleViewModel = function () { var self = this; self.propertyOne = ko.observable(); self.propertyTwo = ko.observable(); self.propertyThree = ko.computed(function () { return self.propertyOne() + self.propertyTwo(); }); }; This simple ViewModel has three properties.…