member_webapp/src/app/app-routing.module.ts
2018-05-18 17:30:20 +09:00

17 lines
678 B
TypeScript

import { NgModule } from '@angular/core';
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { AuthGuard } from './commons/guard/auth.guard';
const routes: Routes = [
{ path: '', loadChildren: './pages/pages.module#PagesModule', canActivate: [AuthGuard] },
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
{ path: 'error', loadChildren: './pages/error/error-page.module#ErrorPageModule' },
{ path: '**', redirectTo: 'error' },
];
@NgModule({
imports: [RouterModule.forRoot(routes, {useHash: true, preloadingStrategy: PreloadAllModules})],
exports: [RouterModule],
})
export class AppRoutingModule { }