Last active
June 14, 2017 21:13
-
-
Save michaelchadwick/410dffc425b42a9b0315267f124b5995 to your computer and use it in GitHub Desktop.
angular 2 testing - AppRouting
This file contains hidden or 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 { Routes, RouterModule } from '@angular/router'; | |
import { LoginComponent } from './login/index'; | |
import { HomeComponent } from './home/index'; | |
import { AuthGuard } from './_guards/index'; | |
const appRoutes: Routes = [ | |
{ path: 'login', component: LoginComponent }, | |
{ path: 'logout', component: LoginComponent, canActivate: [AuthGuard] }, | |
{ path: '', component: HomeComponent, canActivate: [AuthGuard] }, | |
// otherwise redirect to home | |
{ path: '**', redirectTo: '' } | |
]; | |
export const routing = RouterModule.forRoot(appRoutes); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment