Skip to content

Instantly share code, notes, and snippets.

@kaflan
Created November 12, 2017 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaflan/5b67a5e276d0f9876f7801f215f2cef7 to your computer and use it in GitHub Desktop.
Save kaflan/5b67a5e276d0f9876f7801f215f2cef7 to your computer and use it in GitHub Desktop.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import {AuthComponent} from './auth/auth.component';
import {BlocksViewComponent} from './blocks-view/blocks-view.component';
import {ImageUploadComponent} from './image-upload/image-upload.component';
import {TableViewComponent} from './table-view/table-view.component';
import {AuthGuardService} from './services/auth/auth-guard-service.service';
import {AuthService} from './services/auth/auth-service.service';
const routes: Routes = [
{
path: '', redirectTo: 'signIn', pathMatch: 'full'
},
{
path: 'signIn', component: AuthComponent,
},
{
path: 'upload', component: ImageUploadComponent
},
{
path: 'table', component: TableViewComponent
},
{
path: 'block', component: BlocksViewComponent
},
{
path: 'signOut' , redirectTo: 'signIn', pathMatch: 'full',
canActivate: [AuthService]
}
];
@NgModule({
imports: [
CommonModule,
RouterModule.forRoot(routes)
],
exports: [ RouterModule ],
declarations: []
})
export class AppRoutingModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment