Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (42 sloc) 1.01 KB
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { AuthGuard } from './auth/auth.guard';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { InterceptorService } from './auth/secure.interceptor';
import { HomeComponent } from './pages/home/home.component';
import { CallbackComponent } from './pages/callback.component';
import { ProfileComponent } from './pages/profile/profile.component';
@NgModule({
imports: [
RouterModule.forRoot([
{
path: 'callback',
component: CallbackComponent
},
{
path: 'profile',
component: ProfileComponent,
canActivate: [
AuthGuard
]
},
{
path: '',
component: HomeComponent,
pathMatch: 'full'
}
])
],
providers: [
AuthGuard,
{
provide: HTTP_INTERCEPTORS,
useClass: InterceptorService,
multi: true
}
],
exports: [
RouterModule
]
})
export class AppRoutingModule {}
You can’t perform that action at this time.