Skip to content

Instantly share code, notes, and snippets.

@gpincheiraa
Created April 14, 2019 20:14
Show Gist options
  • Save gpincheiraa/dd591e365f4033308b82634dd54d9320 to your computer and use it in GitHub Desktop.
Save gpincheiraa/dd591e365f4033308b82634dd54d9320 to your computer and use it in GitHub Desktop.
working-frontend-with-stubby_src/app/app-routing.module.ts
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