title: ionic 2 page change event
body: <p>I want to execute some code every time the page changes.</p>
  
  <p>I could add add an <code>ngOnDestroy</code> method to every page. It appears that I could use Ionic 2 page <a href="http://ionicframework.com/docs/v2/api/navigation/NavController/" rel="noreferrer">lifecycle hooks</a> (e.g. <code>ionViewDidUnload</code>) for the exact same effect, but I haven't bothered to test that.I would rather add a single method to the main app class.</p>
  
  <p>I see that you can subscribe to Angular 2 <a href="https://stackoverflow.com/a/38080657/484488">Router events</a>. How do I translate that for use in Ionic 2? I'm getting an error with <code>import { Router } from '@angular/router;</code> in the first place:</p>
  
  <pre><code>TypeScript error: &lt;path&gt;/node_modules/@angular/router/src/common_router_providers.d.ts(9,55): Error TS2305: Module '"&lt;path&gt;/node_modules/@angular/core/index"' has no exported member 'NgModuleFactoryLoader'.
  TypeScript error: &lt;path&gt;/node_modules/@angular/router/src/router.d.ts(14,39): Error TS2305: Module '"&lt;path&gt;/node_modules/@angular/core/index"' has no exported member 'NgModuleFactoryLoader'.
  TypeScript error: &lt;path&gt;/node_modules/@angular/router/src/router_module.d.ts(9,10): Error TS2305: Module '"&lt;path&gt;/node_modules/@angular/core/index"' has no exported member 'ModuleWithProviders'.
  </code></pre>
  
  <p>webpack config</p>
  
  <pre><code>var path = require('path');
  
  
  module.exports = {
    entry: [
      path.normalize('es6-shim/es6-shim.min'),
      'reflect-metadata',
      path.normalize('zone.js/dist/zone'),
      path.resolve('app/app.ts')
    ],
    output: {
      path: path.resolve('www/build/js'),
      filename: 'app.bundle.js',
      pathinfo: false // show module paths in the bundle, handy for debugging
    },
    module: {
      loaders: [
        {
          test: /\.ts$/,
          loader: 'awesome-typescript',
          query: {
            doTypeCheck: true,
            resolveGlobs: false,
            externals: ['typings/browser.d.ts']
          },
          include: path.resolve('app'),
          exclude: /node_modules/
        }
      ],
      noParse: [
        /es6-shim/,
        /reflect-metadata/,
        /zone\.js(\/|\\)dist(\/|\\)zone/
      ]
    },
    resolve: {
      alias: {
        'angular2': path.resolve('node_modules/angular2')
      },
      extensions: ["", ".js", ".ts"]
    }
  };
  </code></pre>
  
  <p>It would make more sense to me anyways if there is a way to use the <code>Nav</code> or <code>NavController</code> service from ionic-angular. Is there a way to do that?</p>