Created
May 14, 2020 20:56
-
-
Save manoj-choudhari-git/1f52568916e2971269693ad54e2100c7 to your computer and use it in GitHub Desktop.
App Routing Module for Azure AD B2C protected Angular App
This file contains 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 { NgModule } from '@angular/core'; | |
import { RouterModule, Routes } from '@angular/router'; | |
import { HomeComponent } from './home/home.component'; | |
import { FetchDataComponent } from './fetch-data/fetch-data.component'; | |
import { CounterComponent } from './counter/counter.component'; | |
import { MsalGuard } from '@azure/msal-angular'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
component: HomeComponent, | |
pathMatch: 'full' | |
}, | |
{ | |
path: 'counter', | |
component: CounterComponent, | |
canActivate: [ | |
MsalGuard | |
] | |
}, | |
{ | |
path: 'fetch-data', | |
component: FetchDataComponent, | |
canActivate: [ | |
MsalGuard | |
] | |
}, | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes, { useHash: false })], | |
exports: [RouterModule] | |
}) | |
export class AppRoutingModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment