title: how to override the default back button in ionic
body: <p>I have three views playlists, playlist, and mediaplayer.</p>
  
  <p>In my project I am getting back button by default. I am debugging an play store app my direction viewing the page is playlists-->playlist-->media player.Also i have separate controller for all there views but i am getting a default back button in playlist and mediaplayer page only.</p>
  
  <p>1).On clicking the back button in playlist page goes to playlists page so there is no problem.</p>
  
  <p>2).On clicking the back button in mediaplayer page goes to playlists page but i need to go to playlist.  </p>
  
  <p>here i have some links that i have gone through but i am not able to understand about </p>
  
  <pre><code>Soft navigation bar button - override $rootScope.$ionicGoBack()
  Hard Android button - use $ionicPlatform.registerBackButtonAction()
  </code></pre>
  
  <p>1).<a href="https://stackoverflow.com/questions/32231737/ionic-override-all-back-button-behaviour-for-specific-controller">Ionic override all BACK button behaviour for specific controller</a>
  2).<a href="https://github.com/driftyco/ionic/issues/399" rel="nofollow noreferrer">https://github.com/driftyco/ionic/issues/399</a><br>
  3).<a href="https://forum.ionicframework.com/t/how-to-handle-a-click-on-the-generated-back-button/582" rel="nofollow noreferrer">https://forum.ionicframework.com/t/how-to-handle-a-click-on-the-generated-back-button/582</a></p>
  
  <p>Please some explain me about overriding the $ionicGoBack(). In my case how to find weather it is Soft navigation bar button or Hard Android button.</p>
  
  <p>When i give inspect element on back button on the page mediaplayer i got this</p>
  
  <pre><code>&lt;button ng-click="$ionicGoBack()" class="button back-button buttons button-clear header-item" tabindex="0"&gt;
         &lt;i class="icon ion-ios-arrow-back"&gt;&lt;/i&gt; 
        &lt;span class="back-text" style="transform: translate3d(0px, 0px, 0px);"&gt;
        &lt;span class="default-title"&gt;Back&lt;/span&gt;
        &lt;span class="previous-title hide"&gt;Home&lt;/span&gt;
       &lt;/span&gt;&lt;/button&gt;
  </code></pre>