]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/core/core.module.ts
3bc0e28853f489117c69822fd4754f3ecf67f4ce
[github/Chocobozzz/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 { ConfirmComponent, 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
23 @NgModule({
24 imports: [
25 CommonModule,
26 RouterModule,
27 FormsModule,
28 BrowserAnimationsModule,
29
30 LoadingBarHttpClientModule,
31 LoadingBarRouterModule,
32 LoadingBarModule,
33 ToastModule,
34
35 HotkeyModule.forRoot({
36 cheatSheetCloseEsc: true
37 })
38 ],
39
40 declarations: [
41 ConfirmComponent,
42 CheatSheetComponent
43 ],
44
45 exports: [
46 LoadingBarHttpClientModule,
47 LoadingBarModule,
48
49 ToastModule,
50
51 ConfirmComponent,
52 CheatSheetComponent
53 ],
54
55 providers: [
56 AuthService,
57 ConfirmService,
58 ServerService,
59 ThemeService,
60 LoginGuard,
61 UserRightGuard,
62 RedirectService,
63 Notifier,
64 MessageService,
65 UserNotificationSocket
66 ]
67 })
68 export class CoreModule {
69 constructor (@Optional() @SkipSelf() parentModule: CoreModule) {
70 throwIfAlreadyLoaded(parentModule, 'CoreModule')
71 }
72 }