dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_I18nModule cluster_I18nModule_providers I18n I18n I18nModule I18nModule I18n->I18nModule

File

src/i18n/i18n.module.ts

Providers

import { NgModule, SkipSelf, Optional } from "@angular/core";

import { I18n } from "./i18n.service";

export { I18n } from "./i18n.service";

// either provides a new instance of ModalPlaceholderService, or returns the parent
export function I18N_SERVICE_PROVIDER_FACTORY(parentService: I18n) {
	return parentService || new I18n();
}

// placholder service *must* be a singleton to ensure the placeholder viewref is accessible globally
export const I18N_SERVICE_PROVIDER = {
	provide: I18n,
	deps: [[new Optional(), new SkipSelf(), I18n]],
	useFactory: I18N_SERVICE_PROVIDER_FACTORY
};

@NgModule({
	providers: [
		I18n,
		I18N_SERVICE_PROVIDER
	]
})
export class I18nModule {}

results matching ""

    No results matching ""