title: Get current page / view name in ionic 2 rc0
body: <p>I want to handle navigation based on the current view name.</p>
  
  <p>So when the user is on any other view I want the back button to take the user to the home page. And if the user in on the home page i want to prompt for exit.</p>
  
  <p>Pretty standard stuff.</p>
  
  <p>I am using the tabs template, I have more pages that the out of the box tabs template.</p>
  
  <p>Currently I am doing the following in my <strong>app.component.ts</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  import { Platform } from 'ionic-angular';
  import { StatusBar } from 'ionic-native';
  
  import { TabsPage } from '../pages/tabs/tabs';
  
  
  @Component({
    template: `&lt;ion-nav [root]="rootPage"&gt;&lt;/ion-nav&gt;`
  })
  export class MyApp {
    rootPage = TabsPage;
  
    constructor(platform: Platform) {
      platform.ready().then(() =&gt; {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        StatusBar.styleDefault();
         platform.registerBackButtonAction(()=&gt;{
           //how do i handle back button
         },600)
      });
   }
  
  
  
  }
  </code></pre>