|
|
|
@ -21,6 +21,9 @@ type Controls = { [key: string]: FormControl } | FormGroup[]; |
|
|
|
selector: 'form[ngSubmit][formGroup]', |
|
|
|
}) |
|
|
|
export class FormSubmitDirective implements OnInit, OnDestroy { |
|
|
|
@Input() |
|
|
|
debounce = 200; |
|
|
|
|
|
|
|
@Input() |
|
|
|
notValidateOnSubmit: string | boolean; |
|
|
|
|
|
|
|
@ -42,7 +45,7 @@ export class FormSubmitDirective implements OnInit, OnDestroy { |
|
|
|
|
|
|
|
fromEvent(this.host.nativeElement as HTMLElement, 'keyup') |
|
|
|
.pipe( |
|
|
|
debounceTime(200), |
|
|
|
debounceTime(this.debounce), |
|
|
|
filter((key: KeyboardEvent) => key && key.key === 'Enter'), |
|
|
|
takeUntilDestroy(this), |
|
|
|
) |
|
|
|
|