Skip to content

Commit

Permalink
Use the control.value to get the up to date value inserted by user
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Nov 30, 2023
1 parent 0109eea commit af47451
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,12 @@ export class WorkFormComponent implements OnInit {
formGroup: UntypedFormGroup,
externalIdentifierType: string
): AsyncValidatorFn {
return (control: AbstractControl) => {
return (control: AbstractControl) => {
if(externalIdentifierType === 'isbn') {
if(!(formGroup.controls.externalIdentifierId.value?.lenght === 10 || formGroup.controls.externalIdentifierId.value === 13)) {
if(!(control.value?.length === 10 || control.value?.length === 13)) {
return of({ validFormat: true, })
} else {
return of({})
}
} else {
return this._workService
Expand Down Expand Up @@ -317,8 +319,8 @@ export class WorkFormComponent implements OnInit {
}
})
)
}
}
}
}

private checkWorkIdentifiersChanges(
Expand Down

0 comments on commit af47451

Please sign in to comment.