@Ward, Thanks for your reply.
First of all, I forgot to mention that I am using Breeze version 1.4.0.
You checked the network traffic, and you see that {MyUnmappedProperty: "testString} actually goes through the cable: Yes, I checked it and included it in the JSON sending from the server.
To create the behavior I'm experiencing, 3 small additions to the spa template are required.
In todo.view.html I add the button "myGetBtn" and span "mySpan" with an angular binding:
... <button data-ng-click="addTodoList()">Add Todo list</button> <br/> <p> <button id="myGetBtn" ng-click="getTodos(true)">Get todos</button> </p> <article class="todoList" data-ng-repeat="list in todoLists"> <header> <form data-ng-submit="endEdit(list)"> <span id="mySpan">myNotMappedProperty: {{list.MyNotMappedProperty}}</span> <input data-ng-model="list.title" data-selected-when="list.isEditingListTitle" data-ng-click="clearErrorMessage(list)" data-on-blur="endEdit(list)"/> </form> </header> ...
In the .Net POCO TodoList class add
[NotMapped] public string MyNotMappedProperty { get { return "testString"; } }
In todo.model.js I modify the constructor as follows:
function TodoList() { this.title = "My todos"; // defaults this.userId = "to be replaced"; this.MyNotMappedProperty = ""; }
Now, if you started the application and successfully logged in, {{list.MyNotMappedProperty}} shows an empty line, if you then click the "Get Todos" button, {{list.MyNotMappedProperty}} displays the value "testString".
In both cases, the request is the same and returns Json:
[{"$id":"1","$type":"TodoTest.Models.TodoList, TodoTest","TodoListId":5,"UserId":"kostas","Title":"My todos","MyNotMappedProperty":"testString","Todos":[{"$id":"2","$type":"TodoTest.Models.TodoItem, TodoTest","TodoItemId":4,"Title":"dasdas","IsDone":false,"TodoListId":5,"TodoList":{"$ref":"1"}}]}]
I would like to get the "testString" shown first without pressing the button that I added.
I don't know if the information I provided is enough to reproduce the behavior, so please tell me if you need more information.
Thanks.