]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/app.module.ts
Redesign account's channels page
[github/Chocobozzz/PeerTube.git] / client / src / app / app.module.ts
CommitLineData
67ed6552 1import 'focus-visible'
1d22d251 2import { environment } from 'src/environments/environment'
67ed6552 3import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
68f6c87a 4import { NgModule } from '@angular/core'
df98563e 5import { BrowserModule } from '@angular/platform-browser'
1d22d251 6import { ServiceWorkerModule } from '@angular/service-worker'
63ac2857 7import { ServerService } from '@app/core'
67ed6552 8import localeOc from '@app/helpers/locales/oc'
ecb4e35f 9import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
df98563e
C
10import { AppRoutingModule } from './app-routing.module'
11import { AppComponent } from './app.component'
df98563e 12import { CoreModule } from './core'
f0b56fdd 13import { EmptyComponent } from './empty.component'
5fb2e288 14import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
1942f11d 15import { HighlightPipe } from './header/highlight.pipe'
1d22d251 16import { LanguageChooserComponent, MenuComponent, NotificationComponent } from './menu'
67ed6552
C
17import { ConfirmComponent } from './modal/confirm.component'
18import { CustomModalComponent } from './modal/custom-modal.component'
19import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component'
20import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component'
21import { WelcomeModalComponent } from './modal/welcome-modal.component'
22import { SharedFormModule } from './shared/shared-forms'
23import { SharedGlobalIconModule } from './shared/shared-icons'
24import { SharedInstanceModule } from './shared/shared-instance'
25import { SharedMainModule } from './shared/shared-main'
26import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings'
2a39506c
C
27
28registerLocaleData(localeOc, 'oc')
693b1aba 29
ab32b0fc
C
30@NgModule({
31 bootstrap: [ AppComponent ],
67ed6552 32
ab32b0fc 33 declarations: [
b33f657c 34 AppComponent,
f0b56fdd 35 EmptyComponent,
b33f657c
C
36
37 MenuComponent,
8afc19a6 38 LanguageChooserComponent,
d3217560 39 QuickSettingsModalComponent,
51a83970 40 NotificationComponent,
43d0ea7f 41 HeaderComponent,
f409f0c3 42 SearchTypeaheadComponent,
6af662a5 43 SuggestionComponent,
1942f11d 44 HighlightPipe,
43d0ea7f 45
437e8e06 46 CustomModalComponent,
43d0ea7f 47 WelcomeModalComponent,
67ed6552
C
48 InstanceConfigWarningModalComponent,
49 ConfirmComponent
ab32b0fc 50 ],
67ed6552 51
693b1aba 52 imports: [
ab32b0fc 53 BrowserModule,
1d22d251 54 ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
23bcf666 55
693b1aba 56 CoreModule,
67ed6552
C
57 SharedMainModule,
58 SharedFormModule,
59 SharedUserInterfaceSettingsModule,
60 SharedGlobalIconModule,
61 SharedInstanceModule,
693b1aba 62
55b33946
C
63 MetaModule.forRoot({
64 provide: MetaLoader,
399b3bc9
C
65 useFactory: (serverService: ServerService) => {
66 return new MetaStaticLoader({
67 pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
68 pageTitleSeparator: ' - ',
69 get applicationName () { return serverService.getTmpConfig().instance.name },
70 defaults: {
71 get title () { return serverService.getTmpConfig().instance.name },
72 get description () { return serverService.getTmpConfig().instance.shortDescription }
73 }
74 })
75 },
63ac2857 76 deps: [ ServerService ]
a51bad1a
C
77 }),
78
a9614776 79 AppRoutingModule // Put it after all the module because it has the 404 route
ab32b0fc 80 ],
361dcebc 81
989e526a 82 providers: [
8cc56c7f
C
83 {
84 provide: APP_BASE_HREF,
85 useValue: '/'
66357162 86 }
989e526a 87 ]
ab32b0fc 88})
63c4db6d 89export class AppModule {}