<commit_before>import { ModuleWithProviders, ApplicationRef } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Http, ConnectionBackend } from '@angular/http';

import { ModuleLoaderService } from './common_module';

import { HomeComponent } from './app';

const loadModule = (moduleName) => {
  return () => {
    return ModuleLoaderService.load(moduleName);
  }
};

// 定义模块 - URL 映射
let modules: Array<{ path: string, module: string }> = [
  { path: 'demo1', module: 'demo1' }
];

let dynamicRoutes = [];

modules.forEach(m => {
  dynamicRoutes.push({
    path: m.path,
    loadChildren: loadModule(m.module),
  });
});

const appRoutes: Routes = [
  { path: '', component: HomeComponent },
  ...dynamicRoutes
];

console.log(appRoutes);

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: false });<commit_msg>Use hash router<commit_after>import { ModuleWithProviders, ApplicationRef } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Http, ConnectionBackend } from '@angular/http';

import { ModuleLoaderService } from './common_module';

import { HomeComponent } from './app';

const loadModule = (moduleName) => {
  return () => {
    return ModuleLoaderService.load(moduleName);
  }
};

// 定义模块 - URL 映射
let modules: Array<{ path: string, module: string }> = [
  { path: 'demo1', module: 'demo1' }
];

let dynamicRoutes = [];

modules.forEach(m => {
  dynamicRoutes.push({
    path: m.path,
    loadChildren: loadModule(m.module),
  });
});

const appRoutes: Routes = [
  { path: '', component: HomeComponent },
  ...dynamicRoutes
];

console.log(appRoutes);

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true });
{'fraction_non_alphanumeric': 0.15679639029892836, 'fraction_numerical': 0.0022560631697687537, 'mean_word_length': 4.458461538461538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7276250', 'n_tokens_mistral': 567, 'n_tokens_neox': 574, 'n_words': 134}