title: Angular Router use function to get routes
body: <p>How i can call function in routes config to set children routes at Angular 5?
  Example of code:</p>
  
  <pre><code>export const homeRoutes: Routes = [
    {
      path: 'home',
      component: HomeContainer
      children: [
        getChildrenRoutes()
      ]
    }
  ]
  
  @NgModule({
    imports: [
      RouterModule.forChild(homeRoutes),
    ],
    ...
  })
  export class HomeRoutingModule {}
  </code></pre>
  
  <p>Function <code>getChildrenRoutes()</code> return <code>Route</code>. In JIT mode it work well, but if i make AoT building it throws error:</p>
  
  <blockquote>
    <p>ERROR in Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function ...</p>
  </blockquote>