How to use the jsoneditor/dist/jsoneditor.js function in jsoneditor

To help you get started, we’ve selected a few jsoneditor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ng-vcl / ng-vcl / src / json-editor / json-editor.component.ts View on Github external
ngAfterViewInit() {

    this.options.onChange = () => {
      this.value = this.editor.get();
      !!this.onChangeCallback && this.onChangeCallback(this.value);
    };

    this.options.onModeChange = newMode => {
      this.mode = newMode;
    };

    this.editor = new JSONEditor(this.el.nativeElement, this.options);
    this.editor.set(this.value);
  }
github girder / girder / girder / web_client / src / views / widgets / MetadataWidget.js View on Github external
render: function () {
        MetadatumEditWidget.prototype.render.apply(this, arguments);

        const jsonEditorEl = this.$el.find('.g-json-editor');
        this.editor = new JSONEditor(jsonEditorEl[0], {
            mode: 'tree',
            modes: ['code', 'tree'],
            onError: () => {
                events.trigger('g:alert', {
                    text: 'The field contains invalid JSON and can not be viewed in Tree Mode.',
                    type: 'warning'
                });
            }
        });

        if (this.value !== undefined) {
            this.editor.setText(JSON.stringify(this.value));
            this.editor.expandAll();
        }

        return this;
github ng-vcl / ng-vcl / dist / src / components / json-editor / json-editor.component.js View on Github external
JsonEditorComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.options.onChange = function () {
            _this.value = _this.editor.get();
            !!_this.onChangeCallback && _this.onChangeCallback(_this.value);
        };
        this.options.onModeChange = function (newMode) {
            _this.mode = newMode;
        };
        this.editor = new JSONEditor(this.el.nativeElement, this.options);
        this.editor.set(this.value);
    };
    JsonEditorComponent.prototype.getValue = function () {
github ng-vcl / ng-vcl / dist / components / json-editor / json-editor.component.js View on Github external
JsonEditorComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        this.options.onChange = function () {
            _this.value = _this.editor.get();
            !!_this.onChangeCallback && _this.onChangeCallback(_this.value);
        };
        this.options.onModeChange = function (newMode) {
            _this.mode = newMode;
        };
        this.editor = new JSONEditor(this.el.nativeElement, this.options);
        this.editor.set(this.value);
    };
    /**

jsoneditor

A web-based tool to view, edit, format, and validate JSON

Apache-2.0
Latest version published 4 days ago

Package Health Score

85 / 100
Full package analysis

Similar packages