knockoutjs - bindings with parameters triggered on load

后端 未结 3 1021
你的背包
你的背包 2021-01-31 13:20

I\'ve been doing a lot of knockoutjs lately, and I came across a strange occurence.

As you can see in this fiddle http://jsfiddle.net/hqXjv/ when you set up a binding to

3条回答
  •  无人及你
    2021-01-31 14:07

    I think "Note 2" on this knockout page explains it all:

    http://knockoutjs.com/documentation/click-binding.html

    You can avoid the problem by either using:

    Anonymous functions:

    
    

    ... or ...

    The bind method:

    
    

提交回复
热议问题