Skip to content

refactor: minor changes after review #1753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions nativescript-angular/router/ns-platform-location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()");
Expand All @@ -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 {
Expand All @@ -31,25 +31,25 @@ 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 {
throw new Error("NativescriptPlatformLocation.forward() - not implemented");
}

back(): void {
this.locationStartegy.back();
this.locationStrategy.back();
}
}
2 changes: 1 addition & 1 deletion nativescript-angular/router/router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down