### File

`projects/angular-l10n/src/lib/services/l10n-resolver.ts`

### Index

###### Methods

- Async resolve

### Constructor

`constructor(translation: L10nTranslationService)`
Defined in projects/angular-l10n/src/lib/services/l10n-resolver.ts:9

Parameters :

Name | Type | Optional
translation | `L10nTranslationService` | No

### Methods

Async resolve
`resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot)`
Defined in projects/angular-l10n/src/lib/services/l10n-resolver.ts:13

Parameters :

Name | Type | Optional
route | `ActivatedRouteSnapshot` | No
state | `RouterStateSnapshot` | No

Returns : `Promise<void>`

    import { Injectable } from '@angular/core';
    import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';

    import { L10nTranslationService } from './l10n-translation.service';

    @Injectable({
        providedIn: 'root'
    })
    export class L10nResolver implements Resolve<Promise<void>> {

        constructor(private translation: L10nTranslationService) { }

        async resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<void> {
            await this.translation.init();
            await this.translation.loadTranslation(route.data.l10nProviders);
        }
    }

# result-matching ""

# No results matching ""