-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp-routing.module.ts
104 lines (102 loc) · 2.74 KB
/
app-routing.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { CategoriesAndTagsComponent } from './components/categories-and-tags/categories-and-tags.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AboutusComponent } from './components/aboutus/aboutus.component';
import { AuditsComponent } from './components/audits/audits.component';
import { BlogsComponent } from './components/blogs/blogs.component';
import { CreateblogComponent } from './components/createblog/createblog.component';
import { ForbiddenComponent } from './components/forbidden/forbidden.component';
import { HomeComponent } from './components/home/home.component';
import { ProductsComponent } from './components/products/products.component';
import { ProfileComponent } from './components/profile/profile.component';
import { SettingsComponent } from './components/settings/settings.component';
import { SigninComponent } from './components/signin/signin.component';
import { SignupComponent } from './components/signup/signup.component';
import { UsersComponent } from './components/users/users.component';
import { AdminGuard } from './guard/admin/admin.guard';
import { AuthguardGuard } from './guard/auth/authguard.guard';
const routes: Routes = [
{
path:'',
pathMatch:'full',
redirectTo:'/signin'
},
{
path:'home',
canActivate:[AuthguardGuard],
component:HomeComponent
},
{
path:'products',
canActivate:[AuthguardGuard],
component:ProductsComponent
},
{
path:'profile',
canActivate:[AuthguardGuard],
component:ProfileComponent
},
{
path:'blogs',
canActivate:[AuthguardGuard],
component:BlogsComponent
},
{
path:'categoriesAndTags',
canActivate:[AuthguardGuard],
component:CategoriesAndTagsComponent
},
{
path:'create-blog',
canActivate:[AuthguardGuard],
component:CreateblogComponent
},
{
path:'audits',
canActivate:[AuthguardGuard,AdminGuard],
component:AuditsComponent
},
{
path:'contact-us',
canActivate:[AuthguardGuard],
loadChildren:()=>
import('./components/contactus/contactus.module').then(m=>{
return m.ContactusModule
})
},
{
path:'signin',
component:SigninComponent
},
{
path:'about-us',
component:AboutusComponent
},
{
path:'signup',
component:SignupComponent
},
{
path:'users',
canActivate:[AuthguardGuard,AdminGuard],
component:UsersComponent,
},
{
path:'settings',
component:SettingsComponent
},
{
path:'forbidden',
component:ForbiddenComponent
},
{
path:'**',
canActivate:[AuthguardGuard],
component:HomeComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }