From ed6954a40c38c8c300ccbb59412b65fe1eafe55c Mon Sep 17 00:00:00 2001 From: vakrilov Date: Thu, 28 Feb 2019 15:08:54 +0200 Subject: [PATCH] refactor: minor changes after review --- nativescript-angular/router/ns-platform-location.ts | 12 ++++++------ nativescript-angular/router/router.module.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nativescript-angular/router/ns-platform-location.ts b/nativescript-angular/router/ns-platform-location.ts index 311faa5b8..ebd86f067 100644 --- a/nativescript-angular/router/ns-platform-location.ts +++ b/nativescript-angular/router/ns-platform-location.ts @@ -6,7 +6,7 @@ import { routerLog, isLogEnabled } from "../trace"; @Injectable() export class NativescriptPlatformLocation extends PlatformLocation { - constructor(private locationStartegy: NSLocationStrategy) { + constructor(private locationStrategy: NSLocationStrategy) { super(); if (isLogEnabled()) { routerLog("NativescriptPlatformLocation.constructor()"); @@ -18,7 +18,7 @@ export class NativescriptPlatformLocation extends PlatformLocation { } onPopState(fn: LocationChangeListener): void { - this.locationStartegy.onPopState(fn); + this.locationStrategy.onPopState(fn); } onHashChange(_fn: LocationChangeListener): void { @@ -31,18 +31,18 @@ export class NativescriptPlatformLocation extends PlatformLocation { return ""; } get pathname(): string { - return this.locationStartegy.path(); + return this.locationStrategy.path(); } set pathname(_newPath: string) { throw new Error("NativescriptPlatformLocation set pathname - not implemented"); } pushState(state: any, title: string, url: string): void { - this.locationStartegy.pushState(state, title, url, null); + this.locationStrategy.pushState(state, title, url, null); } replaceState(state: any, title: string, url: string): void { - this.locationStartegy.replaceState(state, title, url, null); + this.locationStrategy.replaceState(state, title, url, null); } forward(): void { @@ -50,6 +50,6 @@ export class NativescriptPlatformLocation extends PlatformLocation { } back(): void { - this.locationStartegy.back(); + this.locationStrategy.back(); } } diff --git a/nativescript-angular/router/router.module.ts b/nativescript-angular/router/router.module.ts index 95610d6aa..5246eeea0 100644 --- a/nativescript-angular/router/router.module.ts +++ b/nativescript-angular/router/router.module.ts @@ -29,7 +29,7 @@ const NS_ROUTER_PROVIDERS = [ }, { provide: LocationStrategy, useExisting: NSLocationStrategy }, NativescriptPlatformLocation, - { provide: PlatformLocation, useClass: NativescriptPlatformLocation }, + { provide: PlatformLocation, useExisting: NativescriptPlatformLocation }, RouterExtensions, NSRouteReuseStrategy, { provide: RouteReuseStrategy, useExisting: NSRouteReuseStrategy },