mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
24 lines
538 B
TypeScript
24 lines
538 B
TypeScript
import coreModule from 'app/core/core_module';
|
|
import { JsonExplorer } from '../json_explorer/json_explorer';
|
|
|
|
coreModule.directive('jsonTree', [
|
|
function jsonTreeDirective() {
|
|
return {
|
|
restrict: 'E',
|
|
scope: {
|
|
object: '=',
|
|
startExpanded: '@',
|
|
rootName: '@',
|
|
},
|
|
link: function(scope, elem) {
|
|
var jsonExp = new JsonExplorer(scope.object, 3, {
|
|
animateOpen: true,
|
|
});
|
|
|
|
const html = jsonExp.render(true);
|
|
elem.html(html);
|
|
},
|
|
};
|
|
},
|
|
]);
|