Created
April 14, 2019 20:14
-
-
Save gpincheiraa/dd591e365f4033308b82634dd54d9320 to your computer and use it in GitHub Desktop.
working-frontend-with-stubby_src/app/app-routing.module.ts
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 { Routes, RouterModule } from '@angular/router'; | |
import { LoginComponent } from './pages/login/login.component'; | |
import { AccountBalanceComponent } from './pages/account-balance/account-balance.component'; | |
import { ProfileComponent } from './pages/profile/profile.component'; | |
import { AuthenticatedGuard } from './services/authenticated.guard'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
redirectTo: 'balance', | |
pathMatch: 'full' | |
}, | |
{ | |
path: '', | |
canActivate: [ | |
AuthenticatedGuard | |
], | |
children: [ | |
{ | |
path: 'balance', | |
component: AccountBalanceComponent, | |
}, | |
{ | |
path: 'profile', | |
component: ProfileComponent, | |
}, | |
] | |
}, | |
{ | |
path: 'login', | |
component: LoginComponent | |
} | |
]; | |
@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