title: Angular 6 routing on URL parameters
body: <p>I am trying to configure Angular to route based on URL parameters</p>
  
  <pre><code>const routes: Routes = [
    { matcher: (url: UrlSegment[]) =&gt; {
       console.log(url);
       return url.length === 1 &amp;&amp; url[0].path.indexOf('id=form') &gt; -1 ? ({consumed: url}) : null;
    },
    component: FormComponent },
    { matcher: (url: UrlSegment[]) =&gt; {
       console.log(url);
       return url.length === 1 &amp;&amp; url[0].path.indexOf('id=list') &gt; -1 ? ({consumed: url}) : null;
    },
    component: ListComponent },
    { path: '**',  component: PageComponent }
  ];
  </code></pre>
  
  <p>A URL of <code>/worker?id=form&amp;row=12345</code> should match the first route</p>
  
  <p>A URL of <code>/worker?id=list</code> should match the second route</p>
  
  <p>My issue is that inside my matcher the url.parameters is an empty object so I can't match on it.</p>
  
  <p>Appreciate any help</p>