title: AOT errors when passing parameters to the matcher in Angular Router
body: <p>I'm trying to use a closure to pass parameters to the router matcher. </p>
  
  <pre><code>export function componentMatcher(component) {
      return (url) =&gt; {
         // check some condition using component
         return {
             consumed: url
         };
         return null;
      }
  };
  
  RouterModule.forChild([
      {
          matcher: componentMatcher('foo'),
          redirectTo: 'foo'
  </code></pre>
  
  <p>This fails when compiling to AOT with:</p>
  
  <pre><code>ERROR in Error during template compile of 'ComponentPageModule'
    Function expressions are not supported in decorators in 'ɵ0'
      'ɵ0' contains the error at src/app/example-components/component-page/component-page.module.ts(31,30)
        Consider changing the function expression into an exported function.
  </code></pre>
  
  <p>Without the parameter requirement it's pretty simple to fix:</p>
  
  <pre><code>export function componentMatcher(url) =&gt; {
      // check some condition using component
      return {
          consumed: url
      };
      return null;
   }
  </code></pre>
  
  <p>How can I pass a parameter and make this AOT compliant?  </p>