# Ionic back-button event

**URL:** <https://forum.ionicframework.com/t/ionic-back-button-event/80005>\
**Category:** ionic-v3\
**Created:** [February 17, 2017, 11:56am UTC](https://forum.ionicframework.com/t/ionic-back-button-event/80005 "2017-02-17T11:56:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anton\_klochko](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@anton\_klochko](https://forum.ionicframework.com/u/anton_klochko)\
**Post date:** [February 17, 2017, 11:56am UTC](https://forum.ionicframework.com/t/ionic-back-button-event/80005/1 "2017-02-17T11:56:12Z")

</div>

Hi all ! Could anyone suggest please, is it possible handle event on back-button in the header ?

---

<div class="post-metadata">

**Author:** ![justinestrada](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@justinestrada](https://forum.ionicframework.com/u/justinestrada)\
**Post date:** [October 21, 2017, 12:27am UTC](https://forum.ionicframework.com/t/ionic-back-button-event/80005/2 "2017-10-21T00:27:14Z")

</div>

I also would like to know how to handle the back button. I would like to have a function like:

onBackButtonClick(  
preventDefaultBackButton();  
// some other code  
)

---

<div class="post-metadata">

**Author:** ![justinestrada](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@justinestrada](https://forum.ionicframework.com/u/justinestrada)\
**Post date:** [October 26, 2017, 10:26pm UTC](https://forum.ionicframework.com/t/ionic-back-button-event/80005/3 "2017-10-26T22:26:23Z")

</div>

I was able to figure it out!  
In the .html I put:

```auto
<ion-header>
	<ion-navbar>
		    <ion-buttons left>
		        <button ion-button icon-only (click)="onBackButton()" >
		            <ion-icon name="arrow-back"></ion-icon>
		        </button>
		    </ion-buttons>
	    <ion-title>Roof Systems</ion-title>
 	</ion-navbar>
</ion-header>

```

In the .ts TypeScript, I put:

```auto
onBackButton() {
              let check: boolean = false;
               // functionality code
		if ( check ) {
			this.navCtrl.pop();	
		}				
	}

```
