Browse Source

Update entity-list.component.ts

pull/11337/head
Vladyslav Prykhodko 2 years ago
committed by GitHub
parent
commit
69ff2bb506
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      ui-ngx/src/app/shared/components/entity/entity-list.component.ts

11
ui-ngx/src/app/shared/components/entity/entity-list.component.ts

@ -56,6 +56,11 @@ import { coerceBoolean } from '@shared/decorators/coercion';
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => EntityListComponent), useExisting: forwardRef(() => EntityListComponent),
multi: true multi: true
},
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => EntityListComponent),
multi: true
} }
] ]
}) })
@ -203,6 +208,12 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
this.dirty = true; this.dirty = true;
} }
validate(): ValidationErrors | null {
return this.entityListFormGroup.valid ? null : {
entities: {valid: false}
};
}
private reset() { private reset() {
this.entities = []; this.entities = [];
this.entityListFormGroup.get('entities').setValue(this.entities); this.entityListFormGroup.get('entities').setValue(this.entities);

Loading…
Cancel
Save