diff options
Diffstat (limited to 'client/src/app/app.module.ts')
-rw-r--r-- | client/src/app/app.module.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 9f46d49a2..8fc054d79 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import 'focus-visible' | 1 | import 'focus-visible' |
2 | import { environment } from 'src/environments/environment' | 2 | import { environment } from 'src/environments/environment' |
3 | import { APP_BASE_HREF, registerLocaleData } from '@angular/common' | 3 | import { APP_BASE_HREF, registerLocaleData } from '@angular/common' |
4 | import { NgModule } from '@angular/core' | 4 | import { APP_INITIALIZER, NgModule } from '@angular/core' |
5 | import { BrowserModule } from '@angular/platform-browser' | 5 | import { BrowserModule } from '@angular/platform-browser' |
6 | import { ServiceWorkerModule } from '@angular/service-worker' | 6 | import { ServiceWorkerModule } from '@angular/service-worker' |
7 | import localeOc from '@app/helpers/locales/oc' | 7 | import localeOc from '@app/helpers/locales/oc' |
8 | import { AppRoutingModule } from './app-routing.module' | 8 | import { AppRoutingModule } from './app-routing.module' |
9 | import { AppComponent } from './app.component' | 9 | import { AppComponent } from './app.component' |
10 | import { CoreModule } from './core' | 10 | import { CoreModule, ServerService } from './core' |
11 | import { EmptyComponent } from './empty.component' | 11 | import { EmptyComponent } from './empty.component' |
12 | import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' | 12 | import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' |
13 | import { HighlightPipe } from './header/highlight.pipe' | 13 | import { HighlightPipe } from './header/highlight.pipe' |
@@ -26,6 +26,10 @@ import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings | |||
26 | 26 | ||
27 | registerLocaleData(localeOc, 'oc') | 27 | registerLocaleData(localeOc, 'oc') |
28 | 28 | ||
29 | export function loadConfigFactory (server: ServerService) { | ||
30 | return () => server.loadConfig() | ||
31 | } | ||
32 | |||
29 | @NgModule({ | 33 | @NgModule({ |
30 | bootstrap: [ AppComponent ], | 34 | bootstrap: [ AppComponent ], |
31 | 35 | ||
@@ -67,7 +71,13 @@ registerLocaleData(localeOc, 'oc') | |||
67 | { | 71 | { |
68 | provide: APP_BASE_HREF, | 72 | provide: APP_BASE_HREF, |
69 | useValue: '/' | 73 | useValue: '/' |
70 | } | 74 | }, |
75 | { | ||
76 | provide: APP_INITIALIZER, | ||
77 | useFactory: loadConfigFactory, | ||
78 | deps: [ ServerService ], | ||
79 | multi: true | ||
80 | } | ||
71 | ] | 81 | ] |
72 | }) | 82 | }) |
73 | export class AppModule {} | 83 | export class AppModule {} |