1
- import { Attribute , ChangeDetectorRef , ComponentFactory , ComponentFactoryResolver , ComponentRef , Directive , Inject , InjectionToken , Injector , OnDestroy , EventEmitter , Output , Type , ViewContainerRef , ElementRef , InjectFlags , NgZone , EnvironmentInjector } from '@angular/core' ;
2
- import { ActivatedRoute , ActivatedRouteSnapshot , ChildrenOutletContexts , Data , PRIMARY_OUTLET , RouterOutletContract } from '@angular/router' ;
1
+ import { Attribute , ChangeDetectorRef , ComponentFactory , ComponentFactoryResolver , ComponentRef , Directive , Inject , InjectionToken , Injector , OnDestroy , EventEmitter , Output , Type , ViewContainerRef , ElementRef , InjectFlags , NgZone , EnvironmentInjector , inject } from '@angular/core' ;
2
+ import { ActivatedRoute , ActivatedRouteSnapshot , ChildrenOutletContexts , Data , PRIMARY_OUTLET , Router , RouterOutletContract } from '@angular/router' ;
3
3
4
4
import { Frame , Page , NavigatedData , profile , NavigationEntry } from '@nativescript/core' ;
5
5
@@ -10,11 +10,12 @@ import { NativeScriptDebug } from '../../trace';
10
10
import { DetachedLoader } from '../../cdk/detached-loader' ;
11
11
import { ViewUtil } from '../../view-util' ;
12
12
import { NSLocationStrategy } from './ns-location-strategy' ;
13
- import { Outlet } from './ns-location-utils' ;
13
+ import { defaultNavOptions , Outlet } from './ns-location-utils' ;
14
14
import { NSRouteReuseStrategy } from './ns-route-reuse-strategy' ;
15
15
import { findTopActivatedRouteNodeForOutlet , pageRouterActivatedSymbol , loaderRefSymbol , destroyComponentRef } from './page-router-outlet-utils' ;
16
16
import { registerElement } from '../../element-registry' ;
17
17
import { PageService } from '../../cdk/frame-page/page.service' ;
18
+ import { ExtendedNavigationExtras } from './router-extensions' ;
18
19
19
20
export class PageRoute {
20
21
activatedRoute : BehaviorSubject < ActivatedRoute > ;
@@ -65,6 +66,7 @@ export class PageRouterOutlet implements OnDestroy, RouterOutletContract {
65
66
private isEmptyOutlet : boolean ;
66
67
private viewUtil : ViewUtil ;
67
68
private frame : Frame ;
69
+ private router = inject ( Router ) ;
68
70
69
71
attachEvents : EventEmitter < unknown > = new EventEmitter ( ) ;
70
72
detachEvents : EventEmitter < unknown > = new EventEmitter ( ) ;
@@ -404,7 +406,8 @@ export class PageRouterOutlet implements OnDestroy, RouterOutletContract {
404
406
}
405
407
} ) ;
406
408
407
- const navOptions = this . locationStrategy . _beginPageNavigation ( this . frame ) ;
409
+ this . locationStrategy . _beginPageNavigation ( this . frame ) ;
410
+ const navOptions = { ...defaultNavOptions , ...( this . router . getCurrentNavigation ( ) . extras || { } ) } as ExtendedNavigationExtras ;
408
411
const isReplace = navOptions . replaceUrl && ! navOptions . clearHistory ;
409
412
410
413
// Clear refCache if navigation with clearHistory
0 commit comments