Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3c6f5ab

Browse files
committed
fix(ns-router-link): navigate with urlTree (#728)
closes #724
1 parent 0490605 commit 3c6f5ab

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎nativescript-angular/router/ns-router-link.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,19 @@ export class NSRouterLink implements OnChanges { // tslint:disable-line:directiv
7676
JSON.stringify(this.pageTransition));
7777

7878
const extras = this.getExtras();
79-
this.navigator.navigate(this.commands, extras);
79+
this.navigator.navigateByUrl(this.urlTree, extras);
8080
}
8181

82-
private getExtras() {
82+
private getExtras(): NavigationExtras&NavigationOptions {
8383
const transition = this.getTransition();
84-
constextras: NavigationExtras&NavigationOptions= {
84+
return {
8585
queryParams: this.queryParams,
8686
fragment: this.fragment,
8787
clearHistory: this.clearHistory,
8888
animated: transition.animated,
8989
transition: transition.transition,
90+
relativeTo: this.currentRoute,
9091
};
91-
92-
return (<any>Object).assign(extras,
93-
this.currentRoute.toString() !== "Route(url:'', path:'')" && this.currentRoute);
9492
}
9593

9694
private getTransition(): { animated: boolean, transition?: NavigationTransition } {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /