Strange view of JSON using ng-jsoneditor in AngularJS

Viewed 454

I'm using ng-jsoneditor to show and format JSON data in AngularJSapplication. Following this and this article.

HTML:

<div ng-jsoneditor="onLoad" 
     ng-model="vm.obj.data" 
     options="vm.obj.options" 
     style="width: 400px; height: 300px;">
</div>

JS:

vm.json = {
"Array": [1, 2, 3],
"Boolean": true,
"Null": null,
"Number": 123,
"Object": {
  "a": "b",
  "c": "d"
},
"String": "Hello World"
 };
vm.obj = {
    data: vm.json,
    options: {
      mode: 'tree'
    }
  };
  $scope.onLoad = function (instance) {
    instance.expandAll();
  };

The output looks like this (broken):

enter image description here

1 Answers
Related