I'm finding this a strange place to be at a bit of a loss, but if I cant' do this:
koObserv(koObserv() + 1);
and a method is not provided, am I forced to do:
koObserv = ko.observable(koObserv() + 1)
This seems really clumsy.. is there another way that I'm missing?
Here is a fiddle that demonstrates incrementing:
http://jsfiddle.net/jearles/LbPDK/
As you can see
self.num(self.num() + 1);
does work.I would suggest you to, if you use a lot of increment, create some helper function to do the increment and pass it the reference of your observable. You end up with more readable code.
JS:
HTML:
JSFiddle example
you could abstract these logic into an extend observable