SHARE
TWEET

Untitled

a guest Apr 24th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router';
  3. import { LoginComponent } from './pages/login/login.component';
  4. import { AccountBalanceComponent } from './pages/account-balance/account-balance.component';
  5. import { ProfileComponent } from './pages/profile/profile.component';
  6. import { AuthenticatedGuard } from './services/authenticated.guard';
  7.  
  8. const routes: Routes = [
  9.   {
  10.     path: '',
  11.     redirectTo: 'balance',
  12.     pathMatch: 'full'
  13.   },
  14.   {
  15.     path: '',
  16.     canActivate: [
  17.       AuthenticatedGuard
  18.     ],
  19.     children: [
  20.       {
  21.         path: 'balance',
  22.         component: AccountBalanceComponent,
  23.       },
  24.       {
  25.         path: 'profile',
  26.         component: ProfileComponent,
  27.       },
  28.     ]
  29.   },
  30.   {
  31.     path: 'login',
  32.     component: LoginComponent
  33.   }
  34. ];
  35.  
  36. @NgModule({
  37.   imports: [RouterModule.forRoot(routes)],
  38.   exports: [RouterModule]
  39. })
  40. export class AppRoutingModule { }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top