Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement