title: How to pass parameter to route matcher function in Angular 9?
body: <p>The <code>UrlMatcher</code> API has changed in Angular 9. I was passing a parameter to the matcher helper function as follow in Angular  8:</p>
  
  <pre><code>export function matcherHelper(segments: UrlSegment[], providerParam) {
    //... Logic here
    return ....;
  }
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>{
    matcher: (url) =&gt; matcherHelper(url, 'xxx'),
    loadChildren: () =&gt; import('./xxx/auth.module').then(m =&gt; m.AuthModule),
  }
  </code></pre>
  
  <p>But the above is changed to the following in Angular 9:</p>
  
  <pre><code>{
    matcher: matcherHelper('xxx'),
    loadChildren: () =&gt; import('./xxx/auth.module').then(m =&gt; m.AuthModule),
  }
  </code></pre>
  
  <p>In the above, the <code>UrlSegment[]</code> is passed as the first parameter by default, but since I have two parameters the syntax is invalid because the helper function expects two parameters instead of one.</p>
  
  <p>It only works if I use it as below without any parameter (UrlSegment is passed by default int the following route):</p>
  
  <pre><code>{
    matcher: matcherHelper,
   loadChildren: () =&gt; import('./xxx/auth.module').then(m =&gt; m.AuthModule),
  }
  </code></pre>
  
  <p><a href="https://angular.io/api/router/UrlMatcher" rel="nofollow noreferrer">https://angular.io/api/router/UrlMatcher</a></p>