Didn't see any other questions asking this and can't find the right resource, hopefully someone can point me in the right direction -
var archiveParent = function () {
var msg = 'Archive parent "' + parent().name() + '" ?';
var title = 'Confirm Archive';
isArchiving(true);
return app.showMessage(msg, title, ['Yes', 'No'])
.then(confirmArchive);
function confirmArchive(selectedOption) {
if (selectedOption === 'Yes') {
parent().archived() === true;
save().then(success).fail(failed).fin(finish);
function success() {
router.navigateTo('#/parents');
}
function failed(error) {
cancel();
var errorMsg = 'Error: ' + error.message;
logger.logError(
errorMsg, error, system.getModuleId(vm), true);
}
function finish() {
return selectedOption;
}
}
isArchiving(false);
}
};
var save = function () {
isSaving(true);
return datacontext.saveChanges().fin(complete);
function complete() {
isSaving(false);
}
};
I am changing a Knockout observable's property in the view model but KO does not appear to be firing the hasChanges() property on the EntityManager in the datacontext, therefore Breeze is not 'seeing' any changes to save. I am sure I overlooking something stupid, any ideas?