aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.module.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/app.module.ts')
-rw-r--r--client/src/app/app.module.ts132
1 files changed, 24 insertions, 108 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 3f57897fb..555f412e7 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -1,62 +1,22 @@
1import { ApplicationRef, NgModule } from '@angular/core'; 1import { ApplicationRef, NgModule } from '@angular/core';
2import { BrowserModule } from '@angular/platform-browser'; 2import { BrowserModule } from '@angular/platform-browser';
3import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4import { HttpModule, RequestOptions, XHRBackend } from '@angular/http';
5import { RouterModule } from '@angular/router';
6import { removeNgStyles, createNewHosts } from '@angularclass/hmr'; 3import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
7 4
8import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; 5import { MetaModule, MetaConfig } from 'ng2-meta';
9 6
10import { DropdownModule } from 'ng2-bootstrap/components/dropdown';
11import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar';
12import { PaginationModule } from 'ng2-bootstrap/components/pagination';
13import { ModalModule } from 'ng2-bootstrap/components/modal';
14
15import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
16
17import { MetaConfig, MetaModule } from 'ng2-meta';
18
19/*
20 * Platform and Environment providers/directives/pipes
21 */
22import { ENV_PROVIDERS } from './environment'; 7import { ENV_PROVIDERS } from './environment';
23import { routes } from './app.routes'; 8import { AppRoutingModule } from './app-routing.module';
24// App is our top level component
25import { AppComponent } from './app.component'; 9import { AppComponent } from './app.component';
26import { AppState } from './app.service'; 10import { AppState } from './app.service';
27 11
28import { 12import { AccountModule } from './account';
29 AdminComponent, 13import { AdminModule } from './admin';
30 FriendsComponent, 14import { CoreModule } from './core';
31 FriendAddComponent, 15import { LoginModule } from './login';
32 FriendListComponent, 16import { SharedModule } from './shared';
33 FriendService, 17import { VideosModule } from './videos';
34 MenuAdminComponent, 18
35 RequestsComponent,
36 RequestStatsComponent,
37 RequestService,
38 UsersComponent,
39 UserAddComponent,
40 UserListComponent,
41 UserService
42} from './admin';
43import { AccountComponent, AccountService } from './account';
44import { LoginComponent } from './login';
45import { MenuComponent } from './menu.component'; 19import { MenuComponent } from './menu.component';
46import { AuthService, AuthHttp, RestExtractor, RestService, SearchComponent, SearchService } from './shared';
47import {
48 LoaderComponent,
49 VideosComponent,
50 VideoAddComponent,
51 VideoListComponent,
52 VideoMiniatureComponent,
53 VideoSortComponent,
54 VideoWatchComponent,
55 VideoShareComponent,
56 VideoMagnetComponent,
57 VideoService,
58 WebTorrentService
59} from './videos';
60 20
61const metaConfig: MetaConfig = { 21const metaConfig: MetaConfig = {
62 //Append a title suffix such as a site name to all titles 22 //Append a title suffix such as a site name to all titles
@@ -69,75 +29,31 @@ const metaConfig: MetaConfig = {
69 29
70// Application wide providers 30// Application wide providers
71const APP_PROVIDERS = [ 31const APP_PROVIDERS = [
72 AppState, 32 AppState
73
74 {
75 provide: AuthHttp,
76 useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, authService: AuthService) => {
77 return new AuthHttp(backend, defaultOptions, authService);
78 },
79 deps: [ XHRBackend, RequestOptions, AuthService ]
80 },
81
82 AuthService,
83 RestExtractor,
84 RestService,
85
86 VideoService,
87 SearchService,
88 FriendService,
89 RequestService,
90 UserService,
91 AccountService,
92 WebTorrentService
93]; 33];
94/** 34
95 * `AppModule` is the main entry point into Angular2's bootstraping process
96 */
97@NgModule({ 35@NgModule({
98 bootstrap: [ AppComponent ], 36 bootstrap: [ AppComponent ],
99 declarations: [ 37 declarations: [
100 AccountComponent,
101 AdminComponent,
102 AppComponent, 38 AppComponent,
103 BytesPipe, 39 MenuComponent
104 FriendAddComponent,
105 FriendListComponent,
106 FriendsComponent,
107 LoaderComponent,
108 LoginComponent,
109 MenuAdminComponent,
110 MenuComponent,
111 RequestsComponent,
112 RequestStatsComponent,
113 SearchComponent,
114 UserAddComponent,
115 UserListComponent,
116 UsersComponent,
117 VideoAddComponent,
118 VideoListComponent,
119 VideoMiniatureComponent,
120 VideosComponent,
121 VideoSortComponent,
122 VideoWatchComponent,
123 VideoShareComponent,
124 VideoMagnetComponent
125 ], 40 ],
126 imports: [ // import Angular's modules 41 imports: [
127 BrowserModule, 42 BrowserModule,
128 FormsModule,
129 ReactiveFormsModule,
130 HttpModule,
131 RouterModule.forRoot(routes),
132 43
133 DropdownModule, 44 CoreModule,
134 ProgressbarModule, 45 SharedModule,
135 PaginationModule, 46
136 ModalModule, 47 AppRoutingModule,
137 48
138 FileUploadModule, 49 MetaModule.forRoot(metaConfig),
139 50
140 MetaModule.forRoot(metaConfig) 51 AccountModule,
52 AdminModule,
53 CoreModule,
54 LoginModule,
55 SharedModule,
56 VideosModule
141 ], 57 ],
142 providers: [ // expose our Services and Providers into Angular's dependency injection 58 providers: [ // expose our Services and Providers into Angular's dependency injection
143 ENV_PROVIDERS, 59 ENV_PROVIDERS,