From 2f83769626e75413295b7e3cf3436292b8f1d637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Tue, 7 Nov 2017 16:56:18 +0000 Subject: [PATCH] (chore): Fix transpiler complaints --- src/localize-router.config.ts | 12 ++++++------ src/localize-router.parser.ts | 4 ++-- src/localize-router.service.ts | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/localize-router.config.ts b/src/localize-router.config.ts index 5823eed..3110097 100644 --- a/src/localize-router.config.ts +++ b/src/localize-router.config.ts @@ -1,4 +1,4 @@ -import {Inject, InjectionToken, Provider} from '@angular/core'; +import { Inject, InjectionToken, Provider } from '@angular/core'; /** * Guard to make sure we have single initialization of forRoot @@ -29,17 +29,17 @@ export namespace CacheMechanism { * Boolean to indicate whether to use cached language value * @type {InjectionToken} */ -export const USE_CACHED_LANG = new InjectionToken('USE_CACHED_LANG'); +export const USE_CACHED_LANG = new InjectionToken('USE_CACHED_LANG'); /** * Cache mechanism type * @type {InjectionToken} */ -export const CACHE_MECHANISM = new InjectionToken('CACHE_MECHANISM'); +export const CACHE_MECHANISM = new InjectionToken('CACHE_MECHANISM'); /** * Cache name * @type {InjectionToken} */ -export const CACHE_NAME = new InjectionToken('CACHE_NAME'); +export const CACHE_NAME = new InjectionToken('CACHE_NAME'); /** * Type for default language function @@ -51,13 +51,13 @@ export type DefaultLanguageFunction = (languages: string[], cachedLang?: string, * Function for calculating default language * @type {InjectionToken} */ -export const DEFAULT_LANG_FUNCTION = new InjectionToken('DEFAULT_LANG_FUNCTION'); +export const DEFAULT_LANG_FUNCTION = new InjectionToken('DEFAULT_LANG_FUNCTION'); /** * Boolean to indicate whether prefix should be set for single language scenarios * @type {InjectionToken} */ -export const ALWAYS_SET_PREFIX = new InjectionToken('ALWAYS_SET_PREFIX'); +export const ALWAYS_SET_PREFIX = new InjectionToken('ALWAYS_SET_PREFIX'); /** * Config interface for LocalizeRouter diff --git a/src/localize-router.parser.ts b/src/localize-router.parser.ts index 76245e2..7aa510e 100644 --- a/src/localize-router.parser.ts +++ b/src/localize-router.parser.ts @@ -5,7 +5,7 @@ import { Observable } from 'rxjs/Observable'; import { Observer } from 'rxjs/Observer'; import { Location } from '@angular/common'; import 'rxjs/add/observable/forkJoin'; -import 'rxjs/add/operator/toPromise'; +import 'rxjs/add/observable/toPromise'; import 'rxjs/add/operator/share'; import { CacheMechanism, LocalizeRouterSettings } from './localize-router.config'; @@ -88,7 +88,7 @@ export abstract class LocalizeParser { /** exclude certain routes */ for (let i = children.length - 1; i >= 0; i--) { - if (children[i].data && children[i].data.skipRouteLocalization) { + if (children[i].data && children[i].data['skipRouteLocalization']) { if (this.settings.alwaysSetPrefix) { // add directly to routes this.routes.push(children[i]); diff --git a/src/localize-router.service.ts b/src/localize-router.service.ts index 6b5a470..bf032e3 100644 --- a/src/localize-router.service.ts +++ b/src/localize-router.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Router, NavigationStart, ActivatedRouteSnapshot, NavigationExtras } from '@angular/router'; +import { Router, NavigationStart, ActivatedRouteSnapshot, NavigationExtras, Route } from '@angular/router'; import { Subject } from 'rxjs/Subject'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/forkJoin'; @@ -125,8 +125,8 @@ export class LocalizeRouterService { // This value does not exist in Router before version 4 // so we have to find it indirectly if (event.toString().match(/RouteConfigLoadEnd/)) { - Observable.of(event.route).toPromise().then(function (route) { - self.parser.initChildRoutes(route._loadedConfig.routes); + Observable.of(event.route).toPromise().then(function (route: Route) { + self.parser.initChildRoutes((route)._loadedConfig.routes); }); } };