Created
April 19, 2020 13:35
-
-
Save coderkan/b6d547836944930e13f8e6e3d3cb6cc3 to your computer and use it in GitHub Desktop.
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
const routes: Routes = [ | |
{ path: '', redirectTo: '/home', pathMatch: 'full' }, | |
{ path: 'home', component: HomeComponent }, | |
{ | |
path: 'admin', component: AdminDashboardComponent, | |
canActivate: [AuthGuard], | |
data: { | |
role: 'ROLE_ADMIN' | |
} | |
}, | |
{ path: 'user', component: UserDashboardComponent, | |
canActivate: [AuthGuard], | |
data: { | |
role: 'ROLE_USER' | |
} | |
}, | |
{ path: '**', component: NotFoundComponent } | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes)], | |
exports: [RouterModule] | |
}) | |
export class AppRoutingModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment