I'm occasionally noticing strange behaviour in the data that Umbraco initializes my data types $scope.model.value
value with.
I'm working with Umbraco 7.11.1, and my custom data type is built around a complex JSON based data model.
During "Save and Publish" (from the Umbraco back-office), Umbraco seems to accept the JSON that my controller has stored in $scope.model.value
- no error dialogs are displayed, console errors logged, etc.
When the back-office reloads however, Umbraco attempts to initialize my data type with a partial, malformed JSON string, rather than the expected JSON object (ie that was previously saved).
I'm following the regular pattern for implementing a custom data type, via an angularjs controller:
angular.module('umbraco')
.controller('MyDataType', ['$scope', function ($scope) {
var loadedData = $scope.model.value;
// Do stuff with "loadedData"
$scope.model.value = loadedData;
}])
The issue seems to occur when I have a large amount of data in my JSON model (ie json that would serialize to ~150 characters or more)
Is there a limit to the amount of data that I can store in an Umbraco data type? Or is there something else that I am overlooking here?