import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from './_guards/auth.guard';
// Layouts
import { FullLayoutComponent } from './layouts/full-layout.component';
import { SimpleLayoutComponent } from './layouts/simple-layout.component';
import { P404Component } from './pages/404.component';
import { P500Component } from './pages/500.component';
export const routes: Routes = [
{
path: '',
redirectTo: '/dashboard',
pathMatch: 'full',
},
component: FullLayoutComponent,
canActivate: [AuthGuard],
data: {
title: 'Home'
children: [
path: 'dashboard',
loadChildren: './dashboard/dashboard.module#DashboardModule'
path: 'components',
loadChildren: './components/components.module#ComponentsModule'
path: 'widgets',
loadChildren: './widgets/widgets.module#WidgetsModule'
path: 'charts',
loadChildren: './chartjs/chartjs.module#ChartJSModule'
}
]
{ path: '404', component: P404Component },
{ path: '500', component: P500Component },
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}