Alert before leaving page (navigate back) with Ionic v2
<p>How do you show an <code>alert</code>, that the user must close, before going back to the previous page? I'm using the standard <code>&lt;ion-navbar *navbar&gt;</code> <em>arrow button</em>.</p>

<p>I tried hooking into the <code>NavController</code> event <code>ionViewWillLeave</code> like this, but it doesn't work:</p>

<pre><code>ionViewWillLeave() {
  let alert = Alert.create({
    title: 'Bye',
    subTitle: 'Now leaving',
    buttons: ['OK']
  });
  this.nav.present(alert);
}
</code></pre>

<p>This shows the alert, but doesn't go back once it is closed. If I comment it out, the back button works fine.</p>