$scope.loader.isSaving = true;
var json = {
spread: $scope.spread.toJSON()
};
$scope.flatForm.jsonForm = JSON.stringify(json);
//console.log(JSON.stringify(json).replace(/\"/g, "\\\""));
$timeout.cancel(delay);
delay = $timeout(function() {
SpreadSheetService.save($scope.spread);
}, 300);
当我运行上面的代码时,我遇到了这样的错误。
Uncaught RangeError: Invalid string length
at JSON.stringify (<anonymous>)
at Object.doneFunction (spreadSheetController.js:631)
at HTMLButtonElement.g (sweet-alert.min.js:1)
(anonymous) @ spreadSheetController.js:631
g @ sweet-alert.min.js:1
如何修复此错误? 请帮帮我。