I have put together a file specifically for managing ngx-translate
configuration:
import {
Http
} from '@angular/http';
import {
TranslateHttpLoader
} from '@ngx-translate/http-loader';
import {
TranslateLoader,
TranslateModuleConfig
} from '@ngx-translate/core';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: Http) {
return new TranslateHttpLoader(http);
}
export function translateModuleConfig(): TranslateModuleConfig {
return {
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [Http]
}
};
}
Then, I am simply integrating the following code in my app module's imports
section:
TranslateModule.forRoot(translateModuleConfig)
However, it is not working as expected anymore. Previously, when I had the configuration directly inline instead of using the function, everything was functioning fine. What could be the issue here?