title: Angular2 Routing: redirectTo a dynamically generated string
body: <p>Per default I need to redirect to today's date. Here is the routing config I have for now:</p>
  
  <pre><code>import { CALENDAR_ROUTE } from './_methods/utils';
  
  export const appRoutes: Routes = [
     {
      path: CalendarComponent.path, 
      component: CalendarComponent,
      canActivate: [AuthGuard],
      resolve: refDataResolver,
      data: {
        navi: {
          at: 'main',
          icon: 'navbar-calendar'
        },
        roles: {
          employeeOnly: true
        }
      },
      children: [
        {
          path: '',
          pathMatch: 'full',
          redirectTo: CALENDAR_ROUTE.DEFAULT_MONTH
        },
        {
          path: LAYOUT_MONTH,
          children: [
            {
              path: '',
              pathMatch: 'full',
              redirectTo: CALENDAR_ROUTE.MONTH
            },
            {
              path: ':year/:month',
              component: CalendarMonthViewComponent
            },
          ]
        },
        {
          path: LAYOUT_DAY,
          children: [
            {
              path: '',
              pathMatch: 'full',
              redirectTo: CALENDAR_ROUTE.DAY
            },
            {
              path: ':year/:month/:day',
              component: CalendarDayViewComponent
            },
          ]
        }
      ]
      }
    ];
  </code></pre>
  
  <p>Here is how I generate the strings in <strong>utils.ts</strong>:</p>
  
  <pre><code>import { LAYOUT_MONTH } from './../_classes/const';
  import * as moment from 'moment';
  
  export function getRoute(withDay: boolean, prefix?: string): string {
      const now = moment();
      const day = ( withDay ) ? now.format('DD') : null;
      return [prefix, now.format('YYYY'), now.format('MM'), day]
          .filter( str =&gt; !!str)
          .join('/');
  }
  
  export const CALENDAR_ROUTE = {
      DEFAULT_MONTH: getRoute(false, LAYOUT_MONTH),
      MONTH: getRoute(false),
      DAY: getRoute(true)
  };
  </code></pre>
  
  <p>It all goes well - in dev mode and localhost – until I need to compile it for UAT/PROD, which utilizes AOT builds, which then throws a </p>
  
  <pre><code>ERROR in Error during template compile of 'AppRoutingModule' 
  Function calls are not supported in decorators but 'getRoute' was called in 'appRoutes' 
  'appRoutes' calls 'getRoute' at app/app-routing.module.ts(67,42).
  </code></pre>
  
  <p>I haven't yet found a solution to this problem. There are some issues which would use <code>providers</code> and <code>useValue</code> - but it feels like an overkill right here. Maybe there is a different kind of a workaround? Maybe I should structure my components differently? Any ideas?</p>