I need to update the observed value after creating the view model. In addition, I need to update the value directly in response to the event from the javascript control, without binding the object to the observable. I think it should be very simple, and that I just skip the correct syntax, but I just don't understand.
I created a JSFiddle to illustrate what I'm trying to do. http://jsfiddle.net/toddhd/vwhqU/1/
If you press F12 and watch the console when starting JSFiddle, you will see that the error (s) has been caught.
AppViewModel.firstName('Todd');
Trying to update firstname in this way tells me that AppViewModel does not have a function called "firstName".
AppViewModel().firstName('Todd');
This path tells me that firstName is undefined.
I may have to call Apply Bindings again, but I really don't want to do this to update a single value.
What am I missing?
source share