Skip to content

Commit 47d61cc

Browse files
committed
add params to primary outlet and always make copy
1 parent 32ce30a commit 47d61cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: nativescript-angular/router/ns-location-strategy.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export class NSLocationStrategy extends LocationStrategy {
170170
if (outlet && this.updateStates(outlet, segmentGroup, this.currentUrlTree.queryParams)) {
171171
this.currentOutlet = outlet; // If states updated
172172
} else if (!outlet) {
173-
const rootOutlet = this.createOutlet("primary", null, segmentGroup, null);
173+
const rootOutlet = this.createOutlet("primary", null, segmentGroup, null, null, this.currentUrlTree.queryParams);
174174
this.currentOutlet = rootOutlet;
175175
}
176176

@@ -615,7 +615,7 @@ export class NSLocationStrategy extends LocationStrategy {
615615
segmentGroup: currentSegmentGroup,
616616
isRootSegmentGroup: false,
617617
isPageNavigation: isNewPage,
618-
queryParams
618+
queryParams: {...queryParams}
619619
};
620620

621621
if (!lastState || !equalStateUrls) {
@@ -656,7 +656,7 @@ export class NSLocationStrategy extends LocationStrategy {
656656
segmentGroup: segmentGroup,
657657
isRootSegmentGroup: false,
658658
isPageNavigation: true, // It is a new OutletNode.
659-
queryParams
659+
queryParams: {...queryParams}
660660
};
661661

662662
newOutlet.states = [locationState];

0 commit comments

Comments
 (0)