Here is example
All you need to do is send data to /echo/json
.
I did do a defer
in this example:
$(document).ready(function () {
var viewModel = new PlanDesignModel();
$.when(viewModel.load).always(function(){
ko.applyBindings(viewModel);
});
});
But everything works just fine:
success: function (data) {
var loadedPD = {};
console.log(data);
self.planDesign = ko.mapping.fromJS(planDesignData);
//I want to run the mapping here
}
Note, I did put 1 second delay:
data: {
json: JSON.stringify({
RecordID: '1124',
Name: "Main"
}),
delay: 1
},