使用这个简单的示例模型:
function Person(){
var self = this;
self.firstName = ko.observable();
self.lastName = ko.observable();
self.fullName = ko.computed(function(){
return self.firstName() + ' ' + self.lastName();
});
}
您将如何使用 JayData 实现 FullName?
$data.Entity.extend("Person", {
FirstName: { type: String },
LastName: { type: String },
FullName: ???
});