Rotas dinâmicas com angular 2

Estou desenvolvendo uma aplicação angular2 e queria criar rotas dinâmicas, que fossem geradas a partir de um arquivo .json. Pesquisando achei o seguinte código:

import { Routes ,RouterModule } from '@angular/router';

export const routes: Routes = getScreens();
export const routing = RouterModule.forRoot(routes);

export function getScreens() {
  var results :Array<Object> = Array<Object>();
  let screens :Array<any> = [
  {
    "title": "Home",
    "path":  "home",
    "component" : "app/home/home.module"
  },
  {
    "title":"Team",
    "path":"team",
    "component": "app/team/team.module"
  }
];

  results.push({ path: '' ,redirectTo: 'home', pathMatch:'full'});

  for (let entry of screens) {
    results.push({ path: entry.path, loadChildren: entry.component});
  }

  return results;
}

Mas o seguinte erro acontece quando vou subir a aplicação

client?93b6:101 Error encountered resolving symbol values statically. Calling function 'getScreens', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol routes in C:/Users/02501699165/Downloads/Angular2 ResetRouter/angular2-routertest/src/app/app.routing.ts, resolving symbol routing in C:/Users/02501699165/Downloads/Angular2 ResetRouter/angular2-routertest/src/app/app.routing.ts, resolving symbol routing in C:/Users/02501699165/Downloads/Angular2 ResetRouter/angular2-routertest/src/app/app.routing.ts, resolving symbol AppModule in C:/Users/02501699165/Downloads/Angular2 ResetRouter/angular2-routertest/src/app/app.module.ts, resolving symbol AppModule in C:/Users/02501699165/Downloads/Angular2 ResetRouter/angular2-routertest/src/app/app.module.ts

Não sei o que pode ser. Se alguém tiver uma solução que resolva este erro, ou algum outro jeito de criar rotas dinâmicas com angular2 seria bem útil. Já agradeço a a ajuda de todos.

Tenta, ao inves de referenciar uma function, diretamente ao array screens. Exemplo:

export const routes: Routes = [
  {
    "title": "Home",
    "path":  "home",
    "component" : "app/home/home.module"
  },
  {
    "title":"Team",
    "path":"team",
    "component": "app/team/team.module"
  }
];

Eu seguiria o conselho do @igor_ks, mas fiz algo próximo do que vc quer, dê uma olhada e vê se te atende:

const appRoutes: Routes = getScreens();

export function getScreens() {

  let screens: Routes = [
  {
    path:  "contato",
    component : TabelaComponent
  },
  {
    path:"home",
    component: TabelaComponent
  }
];
  screens.push({ path: '' ,redirectTo: 'home', pathMatch:'full'});
  return screens;
}