如果我尝试通过构造函数扩展 Breeze 中的实体,例如:
breeze.EntityManager('ServiceUrl').metadataStore.registerEntityTypeCtor(
'customer',
function () {
this.orders = ko.observableArray([]);
}
);
尝试设置新属性时出现 Knockout 错误:
myCustomer.orders(newOrders);
错误是:
"Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."
如果我将它添加到构造后初始化程序中,同样的工作。难道我做错了什么?