import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { AppAuthGuard } from './guards/auth.guard'; const routes: Routes = [ { path: '', redirectTo: '/messenger', pathMatch: 'full' }, { path: 'messenger', loadChildren: './pages/messenger/messenger.page.module#AppMessengerPageModule', canActivate: [AppAuthGuard] }, { path: 'account', loadChildren: './pages/account/account.page.module#AppAccountPageModule' }, { path: 'template', loadChildren: './pages/template/template.page.module#AppTemplatePageModule' } ]; @NgModule({ imports: [RouterModule.forRoot(routes, { enableTracing: false })], exports: [RouterModule] }) export class AppRoutingModule {}