Created
April 7, 2020 09:19
App routing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; | |
import { AuthGuard } from './guards/auth.guard'; | |
import { DataResolverService } from './resolver/data-resolver.service'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
redirectTo: '/tabs', | |
pathMatch: 'full' | |
}, | |
{ | |
path: 'tabs', | |
loadChildren: () => | |
import('./pages/tabs/tabs.module').then(m => m.TabsPageModule), | |
canActivate: [AuthGuard] | |
}, | |
{ | |
path: 'login', | |
loadChildren: () => | |
import('./pages/login/login.module').then(m => m.LoginPageModule) | |
}, | |
{ | |
path: 'activities/:name', | |
loadChildren: () => | |
import('./pages/activities/activities-routing.module').then(m => m.ActivitiesRoutingModule) | |
} | |
]; | |
@NgModule({ | |
imports: [ | |
RouterModule.forRoot(routes, { }) | |
], | |
exports: [RouterModule] | |
}) | |
export class AppRoutingModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment