backButtonClick click event ionic 4

Hi all ! Could anyone suggest please, if exist way to handle ion-back-button click like in was it Ionic 3 ?

  this.navBar.backButtonClick = (e: UIEvent) => {

  };

Why not useā€¦

<ion-back-button (click)="backButtonClick($event)"></ion-back-button>
1 Like

You can use Angular Routing concept for Ionic 4.
1.Import below file,
import { Location } from ā€˜@angular/commonā€™;

2.Declare in constructor as,
private location: Location

3.Declare below method.

goBack() {
this.location.back();
}

Call the method in Html file
<button class=ā€œnav_btn back_btn floatLeftā€ (click)=ā€œgoBack()ā€>

1 Like