クリックバインドがfullName関数を呼び出していませんこれを呼び出す正しい方法は何ですか?
<div>
<div data-bind="with: test.name" >
<div>
<span data-bind="text:firstName"></span>
<span data-bind="text:firstName"></span>
<br />
<div>
<span data-bind="click: $parent.fullName">FullName</span>
</div>
</div>
modal = function(){
var firstName = ko.observable('jhon'),
lastName = ko.observable('deo'),
test = {
name : {
firstName: firstName,
lastName: lastName
},
fullName : function(){
alert(name.firstName() + name.lastName());
}
};
return {
test: test
}
}();
ko.applyBindings(modal);