UNPKG

@bespunky/angular-zen

Version:

The Angular tools you always wished were there.

49 lines (48 loc) 2.25 kB
import { ActivatedRoute, Router } from '@angular/router'; import { RouteAware, RouterOutletComponentBus } from '@bespunky/angular-zen/router-x'; import { LanguageIntegrationService } from './language-integration.service'; import * as i0 from "@angular/core"; /** * Integrates with the `LanguageIntegrationService` and facilitates language related work in route-aware services. * * @export * @abstract * @class LocalizedRouteAware * @extends {RouteAware} */ export declare abstract class LocalizedRouteAware extends RouteAware { protected language: LanguageIntegrationService; /** * Creates an instance of LocalizedRouteAware. * * @param {LanguageIntegrationService} language The instance of the language integration service. * @param {Router} router The instance of Angular's router service. * @param {ActivatedRoute} route The instance of Angular's activated route service. * @param {RouterOutletComponentBus} [componentBus] (Optional) The component bus for router-x functionality. * Provide this when you want your route-aware service to have access to the instance(s) of the activated component(s). */ constructor(language: LanguageIntegrationService, router: Router, route: ActivatedRoute, componentBus?: RouterOutletComponentBus); private initLanguageSupport; /** * Called when the app's language services have initialized and are ready for use. * When language integration is disabled, or no ready observable have been provided by the app * this will execute immediatelly on construction time. * * Override to implement. * * @virtual * @protected */ protected onLanguageServicesReady(): void; /** * Called when the current language used by the integrated app has changed. Override to implement. * * @virtual * @protected * @param {*} lang The language code of the new language. */ protected onLanguageChanged(lang: string): void; static ɵfac: i0.ɵɵFactoryDeclaration<LocalizedRouteAware, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<LocalizedRouteAware, never, never, {}, {}, never, never, false>; static ɵprov: i0.ɵɵInjectableDeclaration<LocalizedRouteAware>; }