Thanks to the great Tutorial from John Papa. I tried my best to implement the Revealing Module Pattern for my ViewModel using knockout.js
It is a very simple example:
http://jsfiddle.net/ThomasDeutsch/EHYfT/
Somehow I get not the value returned - but the code that is executed ? I expected to see the result "3" on the screen :)
What am I doing wrong?
You are adding two observables together. Observables are functions. Make sure you use the () form to get the actual value, like this:
addId = ko.computed(function () {
return customer1.Id() + customer2.Id();
}),