we are currently in the process of trying to get breeze and typescript working together... we are using angular and therefore plan on using breeze's "backingStore" model library... we don't plan on using ko or backbone...
// configure to use the model library for Angular
breeze.config.initializeAdapterInstance("modelLibrary", "backingStore", true);
we are defining all typescript entity properties at design time, including key properties... it appears that the "backingStore" implementation fails when the entity has a design time key property AND ALSO a navigation array property. specifically it appears line 4470 of breeze.debug.js is a problem:
npValue.forEach(function(iv) {
iv.setProperty(fkName, newValue);
if i understand things correctly, "npValue" should be an array that holds child entities... if this value is null, the above code fails... this code appears to run when breeze is loading entities client side as a result of a call to the server... and it only happens if the "key" property of the parent is defined explicitly in code inside the entity's constructor function. the call to "movePropsToBackingStore" appears to be deleting properties and then adding them back... when this is done for the key property, this problem arises...
anyway, is this a bug OR does breeze not support explicit definition of key properties? or is something else wrong? to reproduce this issue all you have to do is tweak the NoDb sample as follows:
// configure to use the model library for Angular
breeze.config.initializeAdapterInstance("modelLibrary", "backingStore", true);
var TodoList = function () {
this.title = "My todos";
this.todoListId = null; //explicitly define key prop
};
thank you