2012-10-09 63 views

回答

1

您的標記更改爲:

<button data-bind="click: hello.bind($data, 'Hi!!!')">Say hello</button> 

從文檔:

Alternatively, if you prefer to avoid the function literal in your view, you can use the bind function, which attaches specific parameter values to a function reference.更多關於綁定可以在Mozilla找到。

+0

是的,這個工程!謝謝 – Ilya