|
|
@ -26,9 +26,9 @@ export class FormSubmitDirective implements OnInit { |
|
|
|
|
|
|
|
|
@Input() |
|
|
@Input() |
|
|
notValidateOnSubmit: string | boolean; |
|
|
notValidateOnSubmit: string | boolean; |
|
|
|
|
|
|
|
|
@Input() |
|
|
@Input() |
|
|
markAsDirtyWhenSubmit: boolean = true |
|
|
markAsDirtyWhenSubmit = true |
|
|
|
|
|
|
|
|
@Output() readonly ngSubmit = new EventEmitter(); |
|
|
@Output() readonly ngSubmit = new EventEmitter(); |
|
|
|
|
|
|
|
|
@ -39,14 +39,14 @@ export class FormSubmitDirective implements OnInit { |
|
|
private host: ElementRef<HTMLFormElement>, |
|
|
private host: ElementRef<HTMLFormElement>, |
|
|
private cdRef: ChangeDetectorRef, |
|
|
private cdRef: ChangeDetectorRef, |
|
|
private subscription: SubscriptionService, |
|
|
private subscription: SubscriptionService, |
|
|
) {} |
|
|
) { } |
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
ngOnInit() { |
|
|
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => { |
|
|
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => { |
|
|
if(this.markAsDirtyWhenSubmit){ |
|
|
if (this.markAsDirtyWhenSubmit) { |
|
|
this.markAsDirty(); |
|
|
this.markAsDirty(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.executedNgSubmit = true; |
|
|
this.executedNgSubmit = true; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|