How to handle back button on Ionic 2 : <p>How can I handle the back button action on Ionic 2?</p>

<p>I want to be able to know what to do depending on which page is being shown to the user.</p>

<p>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.</p>

<p>Thanks</p>
