@tilde-nlp/ngx-common 8.1.50 → 8.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9923,25 +9923,28 @@ class MissingTranslationHandlerService {
9923
9923
  }]
9924
9924
  }], () => [], null); })();
9925
9925
 
9926
+ const defaultParser = {
9927
+ provide: TranslateParser,
9928
+ useClass: CustomTranslateParseService,
9929
+ };
9930
+ const defaultMissingTranslationHandler = {
9931
+ provide: MissingTranslationHandler,
9932
+ useClass: MissingTranslationHandlerService,
9933
+ };
9934
+ const defaultLoader = {
9935
+ provide: TranslateLoader,
9936
+ useFactory: (http) => {
9937
+ return new CustomTranslateLoader(http);
9938
+ },
9939
+ deps: [HttpClient],
9940
+ };
9926
9941
  const provideLanguageService = (config) => {
9927
9942
  const ngxTranslateModuleConfig = {
9928
- missingTranslationHandler: {
9929
- provide: MissingTranslationHandler,
9930
- useClass: MissingTranslationHandlerService
9931
- },
9932
- parser: {
9933
- provide: TranslateParser,
9934
- useClass: CustomTranslateParseService,
9935
- }
9943
+ missingTranslationHandler: config.loaders?.missingTranslationHandler ?? defaultMissingTranslationHandler,
9944
+ parser: config.loaders?.parser ?? defaultParser
9936
9945
  };
9937
9946
  if (!config.disableCustomLoader) {
9938
- ngxTranslateModuleConfig.loader = {
9939
- provide: TranslateLoader,
9940
- useFactory: (http) => {
9941
- return new CustomTranslateLoader(http);
9942
- },
9943
- deps: [HttpClient],
9944
- };
9947
+ ngxTranslateModuleConfig.loader = config.loaders?.loader ?? defaultLoader;
9945
9948
  }
9946
9949
  return makeEnvironmentProviders([
9947
9950
  {