Skip to content

Commit

Permalink
(chore): Fix transpiler complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Nov 7, 2017
1 parent 69b5d72 commit 2f83769
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/localize-router.config.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -29,17 +29,17 @@ export namespace CacheMechanism {
* Boolean to indicate whether to use cached language value
* @type {InjectionToken<boolean>}
*/
export const USE_CACHED_LANG = new InjectionToken('USE_CACHED_LANG');
export const USE_CACHED_LANG = new InjectionToken<boolean>('USE_CACHED_LANG');
/**
* Cache mechanism type
* @type {InjectionToken<CacheMechanism>}
*/
export const CACHE_MECHANISM = new InjectionToken('CACHE_MECHANISM');
export const CACHE_MECHANISM = new InjectionToken<CacheMechanism>('CACHE_MECHANISM');
/**
* Cache name
* @type {InjectionToken<string>}
*/
export const CACHE_NAME = new InjectionToken('CACHE_NAME');
export const CACHE_NAME = new InjectionToken<string>('CACHE_NAME');

/**
* Type for default language function
Expand All @@ -51,13 +51,13 @@ export type DefaultLanguageFunction = (languages: string[], cachedLang?: string,
* Function for calculating default language
* @type {InjectionToken<DefaultLanguageFunction>}
*/
export const DEFAULT_LANG_FUNCTION = new InjectionToken('DEFAULT_LANG_FUNCTION');
export const DEFAULT_LANG_FUNCTION = new InjectionToken<DefaultLanguageFunction>('DEFAULT_LANG_FUNCTION');

/**
* Boolean to indicate whether prefix should be set for single language scenarios
* @type {InjectionToken<boolean>}
*/
export const ALWAYS_SET_PREFIX = new InjectionToken('ALWAYS_SET_PREFIX');
export const ALWAYS_SET_PREFIX = new InjectionToken<boolean>('ALWAYS_SET_PREFIX');

/**
* Config interface for LocalizeRouter
Expand Down
4 changes: 2 additions & 2 deletions src/localize-router.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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]);
Expand Down
6 changes: 3 additions & 3 deletions src/localize-router.service.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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((<any>route)._loadedConfig.routes);
});
}
};
Expand Down

0 comments on commit 2f83769

Please sign in to comment.