title: Durandal: How to route away from current view within that view's activate() function?
body: <p>I have the following: </p>
  
  <pre><code>function activate(routeData) {
      // make dataservice call, evaluate results here.  If condition is met, reroute:
      if (true){
         router.navigateTo("#/someRoute");
       }
      alert ("should not be shown");
  }
  </code></pre>
  
  <p>The alert is getting hit however, and <em>then</em> the view changes.   </p>
  
  <p>How do I fully navigate away from the current item and prevent any further code in that vm from being hit?</p>
  
  <p><strong>Update:</strong> </p>
  
  <p>I tried using <code>guardroute</code> but I have to activate the viewModel to call the dataservice that returns the data that determines whether or not I should re-route.  Using guardroute totally prevents the dataservice from getting called (since nothing in the activate function will get hit).  </p>
  
  <p>I also tried returning from the <code>if</code> block but this still loads the view / viewAttached / etc so the UX is glitchy.</p>