Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 52x | /**
* Copyright (c) Siemens 2016 - 2025
* SPDX-License-Identifier: MIT
*/
import { inject, Injector } from '@angular/core';
import { SiNoTranslateServiceBuilder } from './si-no-translate.service-builder';
import { SiTranslateService } from './si-translate.service';
import { SiTranslateServiceBuilder } from './si-translate.service-builder';
export const injectSiTranslateService = (): SiTranslateService =>
/* This is needed for ngx-translate when using the isolated mode for lazy child routes.
* In that case, a new TranslateService is created by ngx-translate which also needs to be used
* by Element components within that route.
* The Builder can be used to check if a new service is available
* and then provide a corresponding SiTranslateService.
*/
(
inject(SiTranslateServiceBuilder, { optional: true }) ?? inject(SiNoTranslateServiceBuilder)
).buildService(inject(Injector));
|