Problem
I have < TypeError: the object is not a function of "at EntityManager.saveChanges. An error occurs when the breeze sends something to the server.
When I read the (long) stack trace, I see that the error is being called inside the Breeze method called InitializeEntityPrototype.prototype.getProperty.
There are other places where you may encounter this error; it's just the place i discovered today.
Cause
Please note that my application uses Knockout (ko). This means that my object model is controlled by the "ko" model adapter, which expects each data property to be ko.observable (a observableor observableArray). This means that your property values are implemented as functions , not primitive data types, arrays, or objects.
Breeze initializes my objects with observable properties, so I don't need to do this on my own. But I need to keep these observables when I install entity models in my code .
One of the most common mistakes in ko programming is to set a property, rather than invoke a property setting tool.
todo.Description("foo");
todo.Description = "foo";
, "foo" todo.Description, ... Breeze .
HTML . ; . . . .
, .
, . , ko. Breeze ko ... , , , . () getProperty:
proto.getProperty = function (propertyName) {
return this[propertyName]();
};
, , this[propertyName] - , .
, , , - . " " ( - ) . .
S.O. .
?
. , entity ... .
. . , , .
"" breeze.debug.js try/catch.
debugger, .
?
, . , .
. getProperty setProperty . , . . , , , , () Breeze.
.