Merge branch 'release/v1.3.0' into develop
[oweals/peertube.git] / client / src / app / core / core.module.ts
1 import { CommonModule } from '@angular/common'
2 import { NgModule, Optional, SkipSelf } from '@angular/core'
3 import { FormsModule } from '@angular/forms'
4 import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
5 import { RouterModule } from '@angular/router'
6 import { LoadingBarModule } from '@ngx-loading-bar/core'
7 import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'
8 import { LoadingBarRouterModule } from '@ngx-loading-bar/router'
9
10 import { AuthService } from './auth'
11 import { ConfirmService } from './confirm'
12 import { throwIfAlreadyLoaded } from './module-import-guard'
13 import { LoginGuard, RedirectService, UserRightGuard } from './routing'
14 import { ServerService } from './server'
15 import { ThemeService } from './theme'
16 import { HotkeyModule } from 'angular2-hotkeys'
17 import { CheatSheetComponent } from './hotkeys'
18 import { ToastModule } from 'primeng/toast'
19 import { Notifier } from './notification'
20 import { MessageService } from 'primeng/api'
21 import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service'
22 import { ServerConfigResolver } from './routing/server-config-resolver.service'
23
24 @NgModule({
25   imports: [
26     CommonModule,
27     RouterModule,
28     FormsModule,
29     BrowserAnimationsModule,
30
31     LoadingBarHttpClientModule,
32     LoadingBarRouterModule,
33     LoadingBarModule,
34     ToastModule,
35
36     HotkeyModule.forRoot({
37       cheatSheetCloseEsc: true
38     })
39   ],
40
41   declarations: [
42     CheatSheetComponent
43   ],
44
45   exports: [
46     LoadingBarHttpClientModule,
47     LoadingBarModule,
48
49     ToastModule,
50
51     CheatSheetComponent
52   ],
53
54   providers: [
55     AuthService,
56     ConfirmService,
57     ServerService,
58     ThemeService,
59     LoginGuard,
60     UserRightGuard,
61     RedirectService,
62     Notifier,
63     MessageService,
64     UserNotificationSocket,
65     ServerConfigResolver
66   ]
67 })
68 export class CoreModule {
69   constructor (@Optional() @SkipSelf() parentModule: CoreModule) {
70     throwIfAlreadyLoaded(parentModule, 'CoreModule')
71   }
72 }