我已经开始使用来自 angular-tools/ng-jsoneditor 的 JSON 编辑器库和 Angular 包装器。
切换到代码视图时,该错误似乎很烦人。有人有类似的吗?
仅当引号出现在该行时才会发生。这几乎是 JSON 的每一行。
使用标准库,没有任何改变。我的想法不多了。
控制器
$scope.obj = { data: null, options: { mode: 'code' } };
$scope.onLoad = function (instance) {
instance.expandAll();
};
看法
<!DOCTYPE html>
<html ng-app="jsonapp" ng-controller="jsonController">
<head>
<meta charset="utf-8" />
<!-- when using the mode "code", it's important to specify charset utf-8 -->
<meta content="charset=utf-8">
<link href="jsoneditor/dist/jsoneditor.min.css" rel="stylesheet" type="text/css">
<script src="jsoneditor/dist/jsoneditor.min.js"></script>
</head>
<body>
<div ng-jsoneditor="onLoad" ng-model="obj.data" options="obj.options" style="height:800px"></div>
</body>
</html>