AngularJS Directive
San-Jeevan opened this issue · comments
Jeevan Sivagnanasuntharam commented
this is not a bug, but a contribution.
I made an angularjs directive for this.
.directive('jsonTree', function () {
return {
restrict: 'EA',
scope: {
data: '=',
expandall: '&',
collapseall: '&'
},
template: '<div></div>',
link: function ($scope, element, attrs) {
var tree;
tree = jsonTree.create($scope.data, element[0]);
}
}
});
html syntax:
<div json-tree data="inspector.reqbody">Invalid json-data, check RAW format</div>
data is the json object.
obviously collapseall and expandall functionality is not there yet, but this is a good starting point
Vera Lobacheva commented
hi,
sorry, but I don't know angular.js good enough and I can't create solution for this problem.