How to implement ion-back-button with custom handler?

There are several places in my app where I want to have a native looking back button like that provided by ion-back-button. However the click handler for ion-back-button does not do what I need in several of the cases.

Is there a way to give ion-back-button a custom click event handler?

Alternatively, is there a way I use the correct native back button icon with a regular ion-button?


What you can do is:

        <ion-buttons slot="start">
            <ion-button color="dark" (click)="goBack()">
                <ion-icon name="arrow-back"></ion-icon>

 // do what u want

I hope this answers what you need. Thanks.