Browse Source

fix bug Json edit dialog: add validate

pull/3061/head
nickAS21 6 years ago
parent
commit
82668c9da2
  1. 4
      ui-ngx/src/app/shared/components/json-object-edit.component.ts

4
ui-ngx/src/app/shared/components/json-object-edit.component.ts

@ -194,7 +194,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va
}
beautifyJSON() {
if (this.jsonEditor) {
if (this.jsonEditor && this.objectValid) {
const res = JSON.stringify(this.modelValue, null, 2);
this.jsonEditor.setValue(res ? res : '', -1);
this.updateView();
@ -202,7 +202,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va
}
minifyJSON() {
if (this.jsonEditor) {
if (this.jsonEditor && this.objectValid) {
const res = JSON.stringify(this.modelValue);
this.jsonEditor.setValue(res ? res : '', -1);
this.updateView();

Loading…
Cancel
Save