|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import {PlatformLocation} from "@angular/common";
|
|
|
|
import {HttpClient, HttpClientModule} from "@angular/common/http";
|
|
|
|
import {HttpClient, HttpClientModule} from "@angular/common/http";
|
|
|
|
import {NgModule} from "@angular/core";
|
|
|
|
import {NgModule} from "@angular/core";
|
|
|
|
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
|
|
|
|
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
|
|
|
@ -56,7 +57,11 @@ const routes: Routes = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// AoT requires an exported function for factories
|
|
|
|
// AoT requires an exported function for factories
|
|
|
|
export function HttpLoaderFactory(http: HttpClient) {
|
|
|
|
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
|
|
|
|
|
|
|
|
const base = platformLocation.getBaseHrefFromDOM();
|
|
|
|
|
|
|
|
if (base.length > 1) {
|
|
|
|
|
|
|
|
return new TranslateHttpLoader(http, `${base}/translations/`, ".json");
|
|
|
|
|
|
|
|
}
|
|
|
|
return new TranslateHttpLoader(http, "/translations/", ".json");
|
|
|
|
return new TranslateHttpLoader(http, "/translations/", ".json");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|