title: Aborting navigation with Meteor iron-router
body: <p>I have a (client-side) router in a Meteor app, and links using the <code>{{pathFor}}</code> helper.</p>
  
  <p>I am setting a <code>dirty</code> flag in the <code>Session</code> when the user changes a form field, and I want to trigger a warning and allow the user to stop navigating away from the page if the flag is set, basically like an <code>onunload</code> handler.</p>
  
  <p>I've tried to do this with:</p>
  
  <pre><code>Router.onBeforeAction(function(pause) {
      var self = this;
  
      if (!this.ready()) {
          return;
      }
  
      if(Session.get('dirty')) {
          if(!confirm("Are you sure you want to navigate away?")) {
              pause();
          }
      }
  });
  </code></pre>
  
  <p>However, whilst I get the prompt, I'm still being navigated away. That is, the <code>pause()</code> doesn't seem to stop the subsequent router action, whatever it is.</p>
  
  <p>What am I doing wrong?</p>