jsontree.ts 497 B

12345678910111213141516171819202122
  1. import coreModule from 'app/core/core_module';
  2. import {JsonExplorer} from '../json_explorer/json_explorer';
  3. coreModule.directive('jsonTree', [function jsonTreeDirective() {
  4. return{
  5. restrict: 'E',
  6. scope: {
  7. object: '=',
  8. startExpanded: '@',
  9. rootName: '@',
  10. },
  11. link: function(scope, elem) {
  12. var jsonExp = new JsonExplorer(scope.object, 3, {
  13. animateOpen: true
  14. });
  15. const html = jsonExp.render(true);
  16. elem.html(html);
  17. }
  18. };
  19. }]);