title: Angular2 routing based on subdomain?
body: <p>I am trying to route in Angular2 Router based on the subdomain in a URL.  For example if someone requests test.domain.com then they get the "test" route.  I could not get router.navigate to work from ngOnInit without setting a timeout delay, but running the following from the constructor works.  Would be interested if there was a cleaner solution ?</p>
  
  <pre><code>{path: 'test',                    component: TestComponent}
  
  this._router.events.subscribe(event =&gt; {
   if (event.constructor.name === 'NavigationEnd'
       &amp;&amp; window.location.hostname == 'test.domain.com'
       &amp;&amp; event.url == '/') {
         console.log(event.url);
         this._router.navigate(['test']);
       }
   });
  </code></pre>