]>
Commit | Line | Data |
---|---|---|
1 | import 'focus-visible' | |
2 | import { APP_BASE_HREF, registerLocaleData } from '@angular/common' | |
3 | import { NgModule } from '@angular/core' | |
4 | import { BrowserModule } from '@angular/platform-browser' | |
5 | import { ServerService } from '@app/core' | |
6 | import localeOc from '@app/helpers/locales/oc' | |
7 | import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' | |
8 | import { AppRoutingModule } from './app-routing.module' | |
9 | import { AppComponent } from './app.component' | |
10 | import { CoreModule } from './core' | |
11 | import { EmptyComponent } from './empty.component' | |
12 | import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' | |
13 | import { HighlightPipe } from './header/highlight.pipe' | |
14 | import { NotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' | |
15 | import { ConfirmComponent } from './modal/confirm.component' | |
16 | import { CustomModalComponent } from './modal/custom-modal.component' | |
17 | import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component' | |
18 | import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component' | |
19 | import { WelcomeModalComponent } from './modal/welcome-modal.component' | |
20 | import { SharedFormModule } from './shared/shared-forms' | |
21 | import { SharedGlobalIconModule } from './shared/shared-icons' | |
22 | import { SharedInstanceModule } from './shared/shared-instance' | |
23 | import { SharedMainModule } from './shared/shared-main' | |
24 | import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings' | |
25 | ||
26 | registerLocaleData(localeOc, 'oc') | |
27 | ||
28 | @NgModule({ | |
29 | bootstrap: [ AppComponent ], | |
30 | ||
31 | declarations: [ | |
32 | AppComponent, | |
33 | EmptyComponent, | |
34 | ||
35 | MenuComponent, | |
36 | LanguageChooserComponent, | |
37 | QuickSettingsModalComponent, | |
38 | NotificationComponent, | |
39 | HeaderComponent, | |
40 | SearchTypeaheadComponent, | |
41 | SuggestionComponent, | |
42 | HighlightPipe, | |
43 | ||
44 | CustomModalComponent, | |
45 | WelcomeModalComponent, | |
46 | InstanceConfigWarningModalComponent, | |
47 | ConfirmComponent | |
48 | ], | |
49 | ||
50 | imports: [ | |
51 | BrowserModule, | |
52 | ||
53 | CoreModule, | |
54 | SharedMainModule, | |
55 | SharedFormModule, | |
56 | SharedUserInterfaceSettingsModule, | |
57 | SharedGlobalIconModule, | |
58 | SharedInstanceModule, | |
59 | ||
60 | MetaModule.forRoot({ | |
61 | provide: MetaLoader, | |
62 | useFactory: (serverService: ServerService) => { | |
63 | return new MetaStaticLoader({ | |
64 | pageTitlePositioning: PageTitlePositioning.PrependPageTitle, | |
65 | pageTitleSeparator: ' - ', | |
66 | get applicationName () { return serverService.getTmpConfig().instance.name }, | |
67 | defaults: { | |
68 | get title () { return serverService.getTmpConfig().instance.name }, | |
69 | get description () { return serverService.getTmpConfig().instance.shortDescription } | |
70 | } | |
71 | }) | |
72 | }, | |
73 | deps: [ ServerService ] | |
74 | }), | |
75 | ||
76 | AppRoutingModule // Put it after all the module because it has the 404 route | |
77 | ], | |
78 | ||
79 | providers: [ | |
80 | { | |
81 | provide: APP_BASE_HREF, | |
82 | useValue: '/' | |
83 | } | |
84 | ] | |
85 | }) | |
86 | export class AppModule {} |