I have an angular reactive form
<form [formGroup]="form" (ngSubmit)="onSubmit()">
I have two buttons to submit. I need to perform a common operation when users press the button, that is submit the form, but also I need to differentiate between the buttons, because I need to redirect the user to different pages, depending on the button pressed. Here is my two buttons:
<button name="Previous" type="submit" [disabled]="form.invalid"> Previous</button>
<button name="Next" type="submit" [disabled]="form.invalid">Next</button>
How can I know in the OnSubmit event which button was pressed?