-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.module.ts
124 lines (120 loc) · 4.33 KB
/
app.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import { ShoppingCartService } from './shopping-cart.service';
import { ProductService } from "./product.service";
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AngularFireModule } from "angularfire2";
import { AngularFireDatabaseModule } from "angularfire2/database";
import { AngularFireAuthModule } from "angularfire2/auth";
import { RouterModule } from "@angular/router";
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { FormsModule } from "@angular/forms";
import {CustomFormsModule} from 'ng2-validation';
import { DataTableModule } from 'angular5-data-table';
import { AppComponent } from "./app.component";
import { environment } from "../environments/environment";
import { BsNavbarComponent } from "./bs-navbar/bs-navbar.component";
import { HomeComponent } from "./home/home.component";
import { ProductsComponent } from "./products/products.component";
import { ShoppingCartComponent } from "./shopping-cart/shopping-cart.component";
import { CheckOutComponent } from "./check-out/check-out.component";
import { OrderSuccessComponent } from "./order-success/order-success.component";
import { MyOrdersComponent } from "./my-orders/my-orders.component";
import { AdminProductsComponent } from "./admin/admin-products/admin-products.component";
import { AdminOrdersComponent } from "./admin/admin-orders/admin-orders.component";
import { LoginComponent } from "./login/login.component";
import { AuthService } from "./auth.service";
import { AuthGuard } from "./auth-guard.service";
import { ProductFormComponent } from "./admin/product-form/product-form.component";
import { UserService } from "./user.service";
import { AdminAuthGuard } from "./admin-auth-guard.service";
import { CategoryService } from "./category.service";
import { ProductFilterComponent } from './products/product-filter/product-filter.component';
import { ProductCardComponent } from './product-card/product-card.component';
import { ProductQuantityComponent } from './product-quantity/product-quantity.component';
import { OrderService } from './order.service';
import { ShoppingCartSummaryComponent } from './shopping-cart-summary/shopping-cart-summary.component';
import { ShippingFormComponent } from './shipping-form/shipping-form.component';
@NgModule({
declarations: [
AppComponent,
BsNavbarComponent,
HomeComponent,
ProductsComponent,
ShoppingCartComponent,
CheckOutComponent,
OrderSuccessComponent,
MyOrdersComponent,
AdminProductsComponent,
AdminOrdersComponent,
LoginComponent,
ProductFormComponent,
ProductFilterComponent,
ProductCardComponent,
ProductQuantityComponent,
ShoppingCartSummaryComponent,
ShippingFormComponent
],
imports: [
BrowserModule,
FormsModule,
CustomFormsModule,
DataTableModule,
AngularFireModule.initializeApp(environment.firebase),
AngularFireDatabaseModule,
AngularFireAuthModule,
NgbModule.forRoot(),
RouterModule.forRoot([
{ path: "", component: ProductsComponent },
{ path: "products", component: ProductsComponent },
{ path: "shopping-cart", component: ShoppingCartComponent },
{ path: "login", component: LoginComponent },
{
path: "check-out",
component: CheckOutComponent,
canActivate: [AuthGuard]
},
{
path: "my/orders",
component: MyOrdersComponent,
canActivate: [AuthGuard]
},
{
path: "order-success/:id",
component: OrderSuccessComponent,
canActivate: [AuthGuard]
},
{
path: "admin/products/new",
component: ProductFormComponent,
canActivate: [AuthGuard, AdminAuthGuard]
},
{
path: "admin/products/:id",
component: ProductFormComponent,
canActivate: [AuthGuard, AdminAuthGuard]
},
{
path: "admin/products",
component: AdminProductsComponent,
canActivate: [AuthGuard, AdminAuthGuard]
},
{
path: "admin/orders",
component: AdminOrdersComponent,
canActivate: [AuthGuard, AdminAuthGuard]
}
])
],
providers: [
AuthService,
AuthGuard,
AdminAuthGuard,
UserService,
CategoryService,
ProductService,
ShoppingCartService,
OrderService
],
bootstrap: [AppComponent]
})
export class AppModule {}