I have a submit and a cancel button in my dialogbox, when i click on submit button the validatation works, but I want when i click on cancel button, form to be closed without need validation...Now when I click on cancel button validation fired and for second time form closed.
HTML code:
<button mat-button (click)="closeDialog()" mat-flat-button>Cancel</button>
ts code:
closeDialog(){
this.dialogRef.close({event:'Cancel'});
}
How I can close form with one click? Thank you...