title: Route that redirects based on custom logic
body: <p>It seems like all the guides for Angular Router talk about redirecting to a specific route. But what happens if you want to redirect to different route based on some internal logic?</p>
  
  <p>For example:</p>
  
  <pre><code>routes: [
   {path: 'link-from-email/:confirmationToken', customFunction: () =&gt; {
      myService.checkTokenStatus(token).subscribe((status) =&gt; {
        if(status === PREMIUM_ACCOUNT) {
          router.navigate('premium-welcome-page');
        } else if(status === BASIC_ACCOUNT) {
          router.navigate('basic-welcome-page');
        } else {
          router.navigate('registration-page');
        }
      });
  }]
  </code></pre>
  
  <p>It seems like the standard way to do this in Angular is by having a route redirect to a component that displays different content in its template, based on what <code>myService</code> returns. But there are use cases for not wanting to include this in one template. For example, in the example above, there are three different pages we may want to display, and we may not find it efficient to contain all of that logic inside a single component. Or, we may want to direct the user to two different flows, each organized into separate directories, rather than containing both pages in one component.</p>
  
  <p>Of course, we can create a dummy component with an empty template just for handling this logic. But that seems inefficient.</p>
  
  <p>Is there a way to contain that logic inside the routes somehow? Or do we always have to redirect to a component?</p>