-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathiwe7-design.module.ts
121 lines (115 loc) · 3.16 KB
/
iwe7-design.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
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { Iwe7DesignDirective } from "./iwe7-design.directive";
import { DesignLayoutComponent } from "./design-layout/design-layout.component";
import { UnderscoreModule } from "iwe7-underscore";
import { Iwe7DesignAddonService } from "./iwe7-design-addon.service";
import {
Iwe7DesignLibraryService,
DESIGN_LIBRARYS
} from "./iwe7-design-library.service";
import { emtryComponents, Libs } from "./components/public_api";
import { RouterModule } from "@angular/router";
import { DesignPage } from "./pages/design/design.component";
import { AddonsPage } from "./pages/addons/addons.component";
import { TemplatePage } from "./pages/template/template.component";
import { ComponentsPage } from "./pages/components/components.component";
import { ResourcePage } from "./pages/resource/resource.component";
import { RoutingPage } from "./pages/routing/routing.component";
import { DatabasePage } from "./pages/database/database.component";
import { HomePage } from "./pages/home/home.component";
import { SwiperModule } from "ngx-swiper-wrapper";
import { SWIPER_CONFIG } from "ngx-swiper-wrapper";
import { SwiperConfigInterface } from "ngx-swiper-wrapper";
const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = {
direction: "horizontal",
slidesPerView: "auto"
};
@NgModule({
imports: [
CommonModule,
UnderscoreModule,
FormsModule,
ReactiveFormsModule,
SwiperModule,
RouterModule.forChild([
{
path: "",
component: RoutingPage,
children: [
{
path: "",
component: DesignPage
},
{
path: "addons",
component: AddonsPage
},
{
path: "template",
component: TemplatePage
},
{
path: "components",
component: ComponentsPage
},
{
path: "resource",
component: ResourcePage
},
{
path: "database",
component: DatabasePage
},
{
path: "home",
component: HomePage
}
]
}
])
],
declarations: [
Iwe7DesignDirective,
DesignLayoutComponent,
DesignPage,
...emtryComponents,
AddonsPage,
TemplatePage,
ComponentsPage,
ResourcePage,
RoutingPage,
DatabasePage,
HomePage
],
exports: [Iwe7DesignDirective, DesignLayoutComponent, RouterModule],
entryComponents: [...emtryComponents],
providers: [
{
provide: SWIPER_CONFIG,
useValue: DEFAULT_SWIPER_CONFIG
}
]
})
export class Iwe7DesignModule {
public static forRoot(comps: any): ModuleWithProviders {
return {
ngModule: Iwe7DesignModule,
providers: [
Iwe7DesignAddonService,
Iwe7DesignLibraryService,
{
provide: DESIGN_LIBRARYS,
useValue: [Libs],
multi: true
},
{
provide: DESIGN_LIBRARYS,
useValue: comps,
multi: true
}
]
};
}
}