Browse Source

Improve json content component

pull/2775/head
Igor Kulikov 6 years ago
parent
commit
4718eac882
  1. 11
      ui-ngx/src/app/shared/components/json-content.component.ts

11
ui-ngx/src/app/shared/components/json-content.component.ts

@ -92,6 +92,15 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
this.validateContentValue = coerceBooleanProperty(value);
}
private validateOnChangeValue: boolean;
get validateOnChange(): boolean {
return this.validateOnChangeValue;
}
@Input()
set validateOnChange(value: boolean) {
this.validateOnChangeValue = coerceBooleanProperty(value);
}
fullscreen = false;
contentBody: string;
@ -256,7 +265,7 @@ export class JsonContentComponent implements OnInit, ControlValueAccessor, Valid
const editorValue = this.jsonEditor.getValue();
if (this.contentBody !== editorValue) {
this.contentBody = editorValue;
this.contentValid = true;
this.contentValid = !this.validateOnChange || this.doValidate();
this.propagateChange(this.contentBody);
}
}

Loading…
Cancel
Save