Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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;
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 () {
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);
};
/**