<commit_before>/**
 * Created by jean-paul.attard on 12/08/2016.
 */

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

import { BaseProtectedComponent } from './base-protected/base-protected.component';

import { AuthGuard } from './core/services/route-guards/auth-guard.service';

const appRoutes: Routes = [
    { path: '', redirectTo: 'a', pathMatch: 'full' },
    {
        path: 'a',
        component: BaseProtectedComponent,
        children: [
            { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
            { path: 'heroes', loadChildren: 'app/+heroes/heroes.module' },
            { path: 'dashboard', loadChildren: 'app/+dashboard/dashboard.module' }
        ],
        canActivate: [ AuthGuard ]
    },
    { path: 'registration', loadChildren: 'app/+registration/registration.module' },
    { path: 'login', loadChildren: 'app/+login/login.module' }
];

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);<commit_msg>Updated routing such that lazy loading is compatabile with webpack.<commit_after>/**
 * Created by jean-paul.attard on 12/08/2016.
 */
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { BaseProtectedComponent } from './base-protected/base-protected.component';
import { AuthGuard } from './core/services/route-guards/auth-guard.service';

const appRoutes: Routes = [
    { path: '', redirectTo: 'a', pathMatch: 'full' },
    {
        path: 'a',
        component: BaseProtectedComponent,
        children: [
            { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
            {
                path: 'heroes',
                loadChildren: () => new Promise(resolve => (
                    require as any).ensure([], () => resolve(require('./+heroes/heroes.module').default))
                )
            },
            {
                path: 'dashboard',
                loadChildren: () => new Promise(resolve => (
                    require as any).ensure([], () => resolve(require('./+dashboard/dashboard.module').default))
                )
            }
        ],
        canActivate: [ AuthGuard ]
    },
    {
        path: 'registration',
        loadChildren: () => new Promise(resolve => (
            require as any).ensure([], () => resolve(require('./+registration/registration.module').default))
        )
    },
    {
        path: 'login',
        loadChildren: () => new Promise(resolve =>
            (require as any).ensure([], () => resolve(require('./+login/login.module').default))
        )
    }
];

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
{'fraction_non_alphanumeric': 0.15754682335659198, 'fraction_numerical': 0.0058758721997796545, 'mean_word_length': 2.4923076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2094637', 'n_tokens_mistral': 783, 'n_tokens_neox': 756, 'n_words': 156}