How do you increment a knockout.js observable?

后端 未结 3 991
情深已故
情深已故 2021-02-07 04:56

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

3条回答
  •  情话喂你
    2021-02-07 05:41

    Here is a fiddle that demonstrates incrementing:

    http://jsfiddle.net/jearles/LbPDK/

    As you can see self.num(self.num() + 1); does work.

提交回复
热议问题