繼續在這裏理解KO。我有一個參數的KO方法之一,它工作時,我傳遞一個明確的價值,但是當我調用該函數與無參數沒有給出KnockoutJS函數的參數在未定義時返回viewModel
<button data-bind="click:LaterCall">click</button>
function InvoiceViewModel() {
//Data
var self = this;
self.LaterCall = function (arg) {
console.log(arg); // why is this not undefined????
};
}
var viewModel = new InvoiceViewModel();
ko.applyBindings(viewModel);
http://jsfiddle.net/sajjansarkar/9TMv2/2/