2 import { environment } from 'src/environments/environment'
3 import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
4 import { NgModule } from '@angular/core'
5 import { BrowserModule } from '@angular/platform-browser'
6 import { ServiceWorkerModule } from '@angular/service-worker'
7 import { ServerService } from '@app/core'
8 import localeOc from '@app/helpers/locales/oc'
9 import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
10 import { AppRoutingModule } from './app-routing.module'
11 import { AppComponent } from './app.component'
12 import { CoreModule } from './core'
13 import { EmptyComponent } from './empty.component'
14 import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
15 import { HighlightPipe } from './header/highlight.pipe'
16 import { LanguageChooserComponent, MenuComponent, NotificationComponent } from './menu'
17 import { ConfirmComponent } from './modal/confirm.component'
18 import { CustomModalComponent } from './modal/custom-modal.component'
19 import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component'
20 import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component'
21 import { WelcomeModalComponent } from './modal/welcome-modal.component'
22 import { SharedFormModule } from './shared/shared-forms'
23 import { SharedGlobalIconModule } from './shared/shared-icons'
24 import { SharedInstanceModule } from './shared/shared-instance'
25 import { SharedMainModule } from './shared/shared-main'
26 import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings'
28 registerLocaleData(localeOc, 'oc')
31 bootstrap: [ AppComponent ],
38 LanguageChooserComponent,
39 QuickSettingsModalComponent,
40 NotificationComponent,
42 SearchTypeaheadComponent,
47 WelcomeModalComponent,
48 InstanceConfigWarningModalComponent,
54 ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
59 SharedUserInterfaceSettingsModule,
60 SharedGlobalIconModule,
65 useFactory: (serverService: ServerService) => {
66 return new MetaStaticLoader({
67 pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
68 pageTitleSeparator: ' - ',
69 get applicationName () { return serverService.getTmpConfig().instance.name },
71 get title () { return serverService.getTmpConfig().instance.name },
72 get description () { return serverService.getTmpConfig().instance.shortDescription }
76 deps: [ ServerService ]
79 AppRoutingModule // Put it after all the module because it has the 404 route
84 provide: APP_BASE_HREF,
89 export class AppModule {}