import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { AuthGuard } from './auth/auth.guard'; const routes: Routes = [ { path: '', redirectTo: 'layout', pathMatch: 'full' }, { path: 'auth', loadChildren: () => import('./auth/auth.module').then(m => m.AuthPageModule) }, // { // path: 'home', // loadChildren: () => import('./home/home.module').then( m => m.HomePageModule), // canLoad: [AuthGuard] // }, // { // path: '', // redirectTo: 'dashboard', // pathMatch: 'full' // }, { path: 'dashboard', loadChildren: () => import('./dashboard/dashboard.module').then( m => m.DashboardPageModule) }, { path: 'layout', loadChildren: () => import('./layout/layout.module').then( m => m.LayoutPageModule), canLoad: [AuthGuard] }, { path: 'splash', loadChildren: () => import('./splash/splash.module').then( m => m.SplashPageModule) }, { path: 'spot', loadChildren: () => import('./spot/spot.module').then( m => m.SpotPageModule), canLoad: [AuthGuard] } ]; @NgModule({ imports: [ RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) ], exports: [RouterModule] }) export class AppRoutingModule { }