@ng-desktop/router 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,5 +34,17 @@ export declare class NativeStackRouteReuseStrategy implements RouteReuseStrategy
|
|
|
34
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<NativeStackRouteReuseStrategy, never>;
|
|
35
35
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Registers [`NativeTitleStrategy`] as Angular's [`TitleStrategy`] so route titles synchronize
|
|
39
|
+
* with native OS window titles via [`NativeTitleService`].
|
|
40
|
+
*
|
|
41
|
+
* Returns `EnvironmentProviders` — pass directly inside `ApplicationConfig.providers` (not `provideNativeRouter(...)`).
|
|
42
|
+
*/
|
|
37
43
|
export declare function withNativeTitleStrategy(appPrefix?: string): EnvironmentProviders;
|
|
44
|
+
/**
|
|
45
|
+
* Registers [`NativeStackRouteReuseStrategy`] as Angular's [`RouteReuseStrategy`] to keep
|
|
46
|
+
* recently visited desktop views cached (bounded LRU, default 16 routes) across back navigation.
|
|
47
|
+
*
|
|
48
|
+
* Returns `EnvironmentProviders` — pass directly inside `ApplicationConfig.providers`.
|
|
49
|
+
*/
|
|
38
50
|
export declare function withNativeRouteReuse(): EnvironmentProviders;
|
|
@@ -74,7 +74,11 @@ export class NativeStackRouteReuseStrategy {
|
|
|
74
74
|
if (!key) {
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
const handle = this.handles.get(key) ?? null;
|
|
78
|
+
if (handle) {
|
|
79
|
+
this.handles.delete(key);
|
|
80
|
+
}
|
|
81
|
+
return handle;
|
|
78
82
|
}
|
|
79
83
|
shouldReuseRoute(future, curr) {
|
|
80
84
|
return future.routeConfig === curr.routeConfig;
|
|
@@ -114,6 +118,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImpor
|
|
|
114
118
|
type: Injectable,
|
|
115
119
|
args: [{ providedIn: 'root' }]
|
|
116
120
|
}] });
|
|
121
|
+
/**
|
|
122
|
+
* Registers [`NativeTitleStrategy`] as Angular's [`TitleStrategy`] so route titles synchronize
|
|
123
|
+
* with native OS window titles via [`NativeTitleService`].
|
|
124
|
+
*
|
|
125
|
+
* Returns `EnvironmentProviders` — pass directly inside `ApplicationConfig.providers` (not `provideNativeRouter(...)`).
|
|
126
|
+
*/
|
|
117
127
|
export function withNativeTitleStrategy(appPrefix = '') {
|
|
118
128
|
return makeEnvironmentProviders([
|
|
119
129
|
{ provide: NATIVE_TITLE_PREFIX, useValue: appPrefix },
|
|
@@ -121,6 +131,12 @@ export function withNativeTitleStrategy(appPrefix = '') {
|
|
|
121
131
|
{ provide: TitleStrategy, useExisting: NativeTitleStrategy },
|
|
122
132
|
]);
|
|
123
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Registers [`NativeStackRouteReuseStrategy`] as Angular's [`RouteReuseStrategy`] to keep
|
|
136
|
+
* recently visited desktop views cached (bounded LRU, default 16 routes) across back navigation.
|
|
137
|
+
*
|
|
138
|
+
* Returns `EnvironmentProviders` — pass directly inside `ApplicationConfig.providers`.
|
|
139
|
+
*/
|
|
124
140
|
export function withNativeRouteReuse() {
|
|
125
141
|
return makeEnvironmentProviders([
|
|
126
142
|
NativeStackRouteReuseStrategy,
|