How to handle back button on Ionic 2
How can I handle the back button action on Ionic 2? I want to be able to know what to do depending on which page is being shown to the user. I didn't find a good answer to this question, but after a while I figured it out myself a way to do it. I'm gonna share with you all. Thanks Here's how I did it: In every Page component, I created a function called backButtonAction() , which will execute custom code for every page. Code: import { Component } from '@angular/core'; import { Platform, NavController, ModalController } from 'ionic-angular'; import { DetailsModal } from './details'; @Component(