Setting RTE value on submit
# package-development
r
Hi, I have a little question (I think) about changing a value of a property from a custom editor layer in Umbraco 13.. I just want to put generated text from the layer into tiny mce property of my node after submit. This works fine for inputs and textareas, but for tinymce this empties the editor and nothing else happens.. You have any suggestions for me? This is the submit function. $scope.submit = function () { $scope.model.umbracoProperty.property.value = $scope.generateResponse.text; notificationsService.success('Success', $scope.model.umbracoProperty.property.label + ' updated'); $scope.model.close(); }
n
I'm guessing this is because the RTE isn't a primitive value - it's a JSON blob as it handles both the markup and blocks. Would need to check the property type before setting and handle RTE separately
r
ok
but if I know it's a RTE, how can I set the value then, do you know how to do that?
ah: umbracoProperty.property.value.markup = $scope.generateResponse.text;
2 Views