Skip to content

Instantly share code, notes, and snippets.

@nhh
Last active May 28, 2018 14:20
Show Gist options
  • Save nhh/8ffa469ed062c187f70c22c3ac25b306 to your computer and use it in GitHub Desktop.
Save nhh/8ffa469ed062c187f70c22c3ac25b306 to your computer and use it in GitHub Desktop.
AppRoutes.ts
import { Routes, RouterModule } from "@angular/router";
import { NgModule } from '@angular/core';
import { AdminComponent } from './component/admin/admin.component';
import { IsAuthenticatedGuard } from '../shared/guard/is-authenticated.guard';
const routes: Routes = [
{
path: 'admin',
canActivate: [IsAuthenticatedGuard],
component: AdminComponent,
}
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRouting {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment