Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add input the by pass markAssubmit
  • Loading branch information
mahmut-gundogdu authored May 23, 2022
2 parents 15671a0 + 2ad158e commit d8737b1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export class FormSubmitDirective implements OnInit {

@Input()
notValidateOnSubmit: string | boolean;

@Input()
markAsDirtyWhenSubmit: boolean = true

@Output() readonly ngSubmit = new EventEmitter();

Expand All @@ -40,7 +43,10 @@ export class FormSubmitDirective implements OnInit {

ngOnInit() {
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => {
this.markAsDirty();
if(this.markAsDirtyWhenSubmit){
this.markAsDirty();
}

this.executedNgSubmit = true;
});

Expand Down

0 comments on commit d8737b1

Please sign in to comment.