|
|
@ -26,6 +26,9 @@ export class FormSubmitDirective implements OnInit { |
|
|
|
|
|
|
|
|
@Input() |
|
|
@Input() |
|
|
notValidateOnSubmit: string | boolean; |
|
|
notValidateOnSubmit: string | boolean; |
|
|
|
|
|
|
|
|
|
|
|
@Input() |
|
|
|
|
|
markAsDirtyWhenSubmit: boolean = true |
|
|
|
|
|
|
|
|
@Output() readonly ngSubmit = new EventEmitter(); |
|
|
@Output() readonly ngSubmit = new EventEmitter(); |
|
|
|
|
|
|
|
|
@ -40,7 +43,10 @@ export class FormSubmitDirective implements OnInit { |
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
ngOnInit() { |
|
|
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => { |
|
|
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => { |
|
|
this.markAsDirty(); |
|
|
if(this.markAsDirtyWhenSubmit){ |
|
|
|
|
|
this.markAsDirty(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.executedNgSubmit = true; |
|
|
this.executedNgSubmit = true; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|