Merge pull request #9215 from umbraco/v8/bugfix/9129-keep-model-value-reference-after-empty

9129 keep model value reference after empty
This commit is contained in:
Warren Buckley
2020-10-20 12:26:40 +01:00
parent 8778e9c84d
commit abc42b5438

View File

@@ -138,10 +138,10 @@
// We need to ensure that the property model value is an object, this is needed for modelObject to recive a reference and keep that updated.
if (typeof newVal !== 'object' || newVal === null) {// testing if we have null or undefined value or if the value is set to another type than Object.
newVal = {};
vm.model.value = newVal = {};
}
modelObject.update(newVal, $scope);
modelObject.update(vm.model.value, $scope);
onLoaded();
}