mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Changes in order to keep server side validation errors into the submission form state
This commit is contained in:
@@ -254,6 +254,13 @@ export class FormComponent implements OnDestroy, OnInit {
|
||||
|
||||
onBlur(event: DynamicFormControlEvent): void {
|
||||
this.blur.emit(event);
|
||||
const control: FormControl = event.control;
|
||||
const fieldIndex: number = (event.context && event.context.index) ? event.context.index : 0;
|
||||
if (control.valid) {
|
||||
this.formService.removeError(this.formId, event.model.name, fieldIndex);
|
||||
} else {
|
||||
this.formService.addControlErrors(control, this.formId, event.model.name, fieldIndex);
|
||||
}
|
||||
}
|
||||
|
||||
onCustomEvent(event: any) {
|
||||
|
Reference in New Issue
Block a user