this is the fiddle - http://jsfiddle.net/iRamesh/36N4m/
Not sure why computed observable is not returning any value. I know how to make it working but not sure why t
In addition to the solution from @RPNiemeyer, there is yet another alternative:
var viewModel = {
firstName: ko.observable("r"),
lastName: ko.observable("j"),
fullName: ko.computed({
read: function() { return viewModel.firstName(); },
deferEvaluation: true
})
};
The computed callback refers to the viewModel variable from the outer scope, and deferEvaluation makes sure the computed will only be called when needed, because at creation time the viewModel variable won't be ready.