@angular/router 21.0.0-next.7 → 21.0.0-next.9
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.
- package/fesm2022/_router-chunk.mjs +194 -145
- package/fesm2022/_router-chunk.mjs.map +1 -1
- package/fesm2022/_router_module-chunk.mjs +27 -26
- package/fesm2022/_router_module-chunk.mjs.map +1 -1
- package/fesm2022/router.mjs +2 -2
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/testing.mjs +11 -11
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +1 -1
- package/fesm2022/upgrade.mjs.map +1 -1
- package/package.json +4 -4
- package/types/_router_module-chunk.d.ts +7 -1
- package/types/router.d.ts +11 -8
- package/types/testing.d.ts +1 -1
- package/types/upgrade.d.ts +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { DOCUMENT, Location } from '@angular/common';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
|
-
import { ɵisPromise as _isPromise, ɵRuntimeError as _RuntimeError, Injectable, ɵisNgModule as _isNgModule, isStandalone, createEnvironmentInjector, InjectionToken, EventEmitter, input, inject, ViewContainerRef, ChangeDetectorRef, Directive, Input, Output, reflectComponentType, Component, ɵisInjectable as _isInjectable, runInInjectionContext, makeEnvironmentProviders, Compiler, NgModuleFactory, ɵresolveComponentResources as _resolveComponentResources, afterNextRender, signal, EnvironmentInjector, DestroyRef, untracked, ɵConsole as _Console, ɵPendingTasksInternal as _PendingTasksInternal, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER } from '@angular/core';
|
|
10
|
-
import { isObservable, from, of, BehaviorSubject, combineLatest, EmptyError, Observable, concat, defer, pipe, throwError, EMPTY,
|
|
11
|
-
import { map, switchMap, take, startWith, filter, takeUntil, mergeMap,
|
|
9
|
+
import { ɵisPromise as _isPromise, ɵRuntimeError as _RuntimeError, Injectable, ɵisNgModule as _isNgModule, isStandalone, createEnvironmentInjector, InjectionToken, EventEmitter, input, inject, ViewContainerRef, ChangeDetectorRef, Directive, Input, Output, reflectComponentType, Component, ɵisInjectable as _isInjectable, runInInjectionContext, makeEnvironmentProviders, Compiler, NgModuleFactory, ɵresolveComponentResources as _resolveComponentResources, afterNextRender, signal, EnvironmentInjector, DestroyRef, untracked, ɵConsole as _Console, ɵPendingTasksInternal as _PendingTasksInternal, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, ɵformatRuntimeError as _formatRuntimeError } from '@angular/core';
|
|
10
|
+
import { isObservable, from, of, BehaviorSubject, combineLatest, EmptyError, Observable, concat, defer, pipe, throwError, EMPTY, Subject, Subscription } from 'rxjs';
|
|
11
|
+
import { first, map, switchMap, take, startWith, filter, takeUntil, mergeMap, concatMap, tap, catchError, scan, defaultIfEmpty, last as last$1, takeLast, finalize } from 'rxjs/operators';
|
|
12
12
|
import * as i1 from '@angular/platform-browser';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -102,6 +102,16 @@ function defaultUrlMatcher(segments, segmentGroup, route) {
|
|
|
102
102
|
return { consumed: segments.slice(0, parts.length), posParams };
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
/** replacement for firstValueFrom in rxjs 7. We must support rxjs v6 so we cannot use it */
|
|
106
|
+
function firstValueFrom(source) {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
source.pipe(first()).subscribe({
|
|
109
|
+
next: (value) => resolve(value),
|
|
110
|
+
error: (err) => reject(err),
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
105
115
|
function shallowEqualArrays(a, b) {
|
|
106
116
|
if (a.length !== b.length)
|
|
107
117
|
return false;
|
|
@@ -167,6 +177,12 @@ function wrapIntoObservable(value) {
|
|
|
167
177
|
}
|
|
168
178
|
return of(value);
|
|
169
179
|
}
|
|
180
|
+
function wrapIntoPromise(value) {
|
|
181
|
+
if (isObservable(value)) {
|
|
182
|
+
return firstValueFrom(value);
|
|
183
|
+
}
|
|
184
|
+
return Promise.resolve(value);
|
|
185
|
+
}
|
|
170
186
|
|
|
171
187
|
const pathCompareMap = {
|
|
172
188
|
'exact': equalSegmentGroups,
|
|
@@ -432,10 +448,10 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
432
448
|
* @publicApi
|
|
433
449
|
*/
|
|
434
450
|
class UrlSerializer {
|
|
435
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
436
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
452
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
437
453
|
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
439
455
|
type: Injectable,
|
|
440
456
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
441
457
|
}] });
|
|
@@ -736,7 +752,7 @@ class UrlParser {
|
|
|
736
752
|
}
|
|
737
753
|
const children = this.parseChildren();
|
|
738
754
|
segments[outletName] =
|
|
739
|
-
Object.keys(children).length === 1
|
|
755
|
+
Object.keys(children).length === 1 && children[PRIMARY_OUTLET]
|
|
740
756
|
? children[PRIMARY_OUTLET]
|
|
741
757
|
: new UrlSegmentGroup([], children);
|
|
742
758
|
this.consumeOptional('//');
|
|
@@ -827,6 +843,9 @@ function isUrlTree(v) {
|
|
|
827
843
|
* @param queryParams The query parameters for the `UrlTree`. `null` if the `UrlTree` does not have
|
|
828
844
|
* any query parameters.
|
|
829
845
|
* @param fragment The fragment for the `UrlTree`. `null` if the `UrlTree` does not have a fragment.
|
|
846
|
+
* @param urlSerializer The `UrlSerializer` to use for handling query parameter normalization.
|
|
847
|
+
* You should provide your application's custom `UrlSerializer` if one is configured to parse and
|
|
848
|
+
* serialize query parameter values to and from objects other than strings/string arrays.
|
|
830
849
|
*
|
|
831
850
|
* @usageNotes
|
|
832
851
|
*
|
|
@@ -864,9 +883,9 @@ function isUrlTree(v) {
|
|
|
864
883
|
* createUrlTreeFromSnapshot(snapshot, ['../../team/44/user/22']);
|
|
865
884
|
* ```
|
|
866
885
|
*/
|
|
867
|
-
function createUrlTreeFromSnapshot(relativeTo, commands, queryParams = null, fragment = null) {
|
|
886
|
+
function createUrlTreeFromSnapshot(relativeTo, commands, queryParams = null, fragment = null, urlSerializer = new DefaultUrlSerializer()) {
|
|
868
887
|
const relativeToUrlSegmentGroup = createSegmentGroupFromRoute(relativeTo);
|
|
869
|
-
return createUrlTreeFromSegmentGroup(relativeToUrlSegmentGroup, commands, queryParams, fragment);
|
|
888
|
+
return createUrlTreeFromSegmentGroup(relativeToUrlSegmentGroup, commands, queryParams, fragment, urlSerializer);
|
|
870
889
|
}
|
|
871
890
|
function createSegmentGroupFromRoute(route) {
|
|
872
891
|
let targetGroup;
|
|
@@ -886,7 +905,7 @@ function createSegmentGroupFromRoute(route) {
|
|
|
886
905
|
const rootSegmentGroup = createRoot(rootCandidate);
|
|
887
906
|
return targetGroup ?? rootSegmentGroup;
|
|
888
907
|
}
|
|
889
|
-
function createUrlTreeFromSegmentGroup(relativeTo, commands, queryParams, fragment) {
|
|
908
|
+
function createUrlTreeFromSegmentGroup(relativeTo, commands, queryParams, fragment, urlSerializer) {
|
|
890
909
|
let root = relativeTo;
|
|
891
910
|
while (root.parent) {
|
|
892
911
|
root = root.parent;
|
|
@@ -895,17 +914,17 @@ function createUrlTreeFromSegmentGroup(relativeTo, commands, queryParams, fragme
|
|
|
895
914
|
// `UrlSegmentGroup`. All we need to do is update the `queryParams` and `fragment` without
|
|
896
915
|
// applying any other logic.
|
|
897
916
|
if (commands.length === 0) {
|
|
898
|
-
return tree(root, root, root, queryParams, fragment);
|
|
917
|
+
return tree(root, root, root, queryParams, fragment, urlSerializer);
|
|
899
918
|
}
|
|
900
919
|
const nav = computeNavigation(commands);
|
|
901
920
|
if (nav.toRoot()) {
|
|
902
|
-
return tree(root, root, new UrlSegmentGroup([], {}), queryParams, fragment);
|
|
921
|
+
return tree(root, root, new UrlSegmentGroup([], {}), queryParams, fragment, urlSerializer);
|
|
903
922
|
}
|
|
904
923
|
const position = findStartingPositionForTargetGroup(nav, root, relativeTo);
|
|
905
924
|
const newSegmentGroup = position.processChildren
|
|
906
925
|
? updateSegmentGroupChildren(position.segmentGroup, position.index, nav.commands)
|
|
907
926
|
: updateSegmentGroup(position.segmentGroup, position.index, nav.commands);
|
|
908
|
-
return tree(root, position.segmentGroup, newSegmentGroup, queryParams, fragment);
|
|
927
|
+
return tree(root, position.segmentGroup, newSegmentGroup, queryParams, fragment, urlSerializer);
|
|
909
928
|
}
|
|
910
929
|
function isMatrixParams(command) {
|
|
911
930
|
return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
|
|
@@ -917,12 +936,39 @@ function isMatrixParams(command) {
|
|
|
917
936
|
function isCommandWithOutlets(command) {
|
|
918
937
|
return typeof command === 'object' && command != null && command.outlets;
|
|
919
938
|
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
939
|
+
/**
|
|
940
|
+
* Normalizes a query parameter value by using the `UrlSerializer` to serialize then parse the value.
|
|
941
|
+
*
|
|
942
|
+
* This ensures that the value is consistent between parsing a URL in the browser on a fresh page load (or page refresh)
|
|
943
|
+
* and a navigation where the query parameter value is passed directly to the router.
|
|
944
|
+
*
|
|
945
|
+
* This also allows custom `UrlSerializer` implementations to define how query parameter values are represented
|
|
946
|
+
* in a `UrlTree`. Since `UrlSerializer` already has a `parse` that takes a string, it already has control
|
|
947
|
+
* over how a browser URL is parsed into a `UrlTree` on initial load/page refresh.
|
|
948
|
+
*/
|
|
949
|
+
function normalizeQueryParams(k, v, urlSerializer) {
|
|
950
|
+
// Hack for empty string query param, which, for whatever reason, happens
|
|
951
|
+
// in a test. Parsing drops empty key params (which might not really be necessary).
|
|
952
|
+
// It's probably really a test issue but I don't have the time to fix it...
|
|
953
|
+
k ||= 'ɵ';
|
|
954
|
+
const tree = new UrlTree();
|
|
955
|
+
tree.queryParams = { [k]: v };
|
|
956
|
+
return urlSerializer.parse(urlSerializer.serialize(tree)).queryParams[k];
|
|
957
|
+
}
|
|
958
|
+
function tree(oldRoot, oldSegmentGroup, newSegmentGroup, queryParams, fragment, urlSerializer) {
|
|
959
|
+
const qp = {};
|
|
960
|
+
for (const [key, value] of Object.entries(queryParams ?? {})) {
|
|
961
|
+
// This retains old behavior where each item in the array was stringified individually This
|
|
962
|
+
// helps remove special-case handling for empty and single-item arrays where the default
|
|
963
|
+
// serializer removes empty arrays when serialized then parsed or converts them to non-arrays
|
|
964
|
+
// for single-item arrays. Changing this could have breaking change implications. Prior code
|
|
965
|
+
// always returned arrays of strings for array inputs so tests, applications, serializers,
|
|
966
|
+
// etc. may only be set up to handle string arrays. We could consider changing this in the
|
|
967
|
+
// future to serialize the entire array as a single value. For now, this feels safer and is
|
|
968
|
+
// at least a step in the right direction.
|
|
969
|
+
qp[key] = Array.isArray(value)
|
|
970
|
+
? value.map((v) => normalizeQueryParams(key, v, urlSerializer))
|
|
971
|
+
: normalizeQueryParams(key, value, urlSerializer);
|
|
926
972
|
}
|
|
927
973
|
let rootCandidate;
|
|
928
974
|
if (oldRoot === oldSegmentGroup) {
|
|
@@ -2119,10 +2165,10 @@ class ChildrenOutletContexts {
|
|
|
2119
2165
|
getContext(childName) {
|
|
2120
2166
|
return this.contexts.get(childName) || null;
|
|
2121
2167
|
}
|
|
2122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
2123
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
2168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: ChildrenOutletContexts, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2169
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2124
2170
|
}
|
|
2125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
2171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2126
2172
|
type: Injectable,
|
|
2127
2173
|
args: [{ providedIn: 'root' }]
|
|
2128
2174
|
}], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
|
|
@@ -2909,10 +2955,10 @@ class RouterOutlet {
|
|
|
2909
2955
|
this.inputBinder?.bindActivatedRouteToOutletComponent(this);
|
|
2910
2956
|
this.activateEvents.emit(this.activated.instance);
|
|
2911
2957
|
}
|
|
2912
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
2913
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0-next.
|
|
2958
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2959
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0-next.9", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, routerOutletData: { classPropertyName: "routerOutletData", publicName: "routerOutletData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 });
|
|
2914
2960
|
}
|
|
2915
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
2961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2916
2962
|
type: Directive,
|
|
2917
2963
|
args: [{
|
|
2918
2964
|
selector: 'router-outlet',
|
|
@@ -2932,7 +2978,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.7",
|
|
|
2932
2978
|
}], detachEvents: [{
|
|
2933
2979
|
type: Output,
|
|
2934
2980
|
args: ['detach']
|
|
2935
|
-
}] } });
|
|
2981
|
+
}], routerOutletData: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerOutletData", required: false }] }] } });
|
|
2936
2982
|
class OutletInjector {
|
|
2937
2983
|
route;
|
|
2938
2984
|
childContexts;
|
|
@@ -3022,10 +3068,10 @@ class RoutedComponentInputBinder {
|
|
|
3022
3068
|
});
|
|
3023
3069
|
this.outletDataSubscriptions.set(outlet, dataSubscription);
|
|
3024
3070
|
}
|
|
3025
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
3026
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
3071
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3072
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RoutedComponentInputBinder });
|
|
3027
3073
|
}
|
|
3028
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
3074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
|
|
3029
3075
|
type: Injectable
|
|
3030
3076
|
}] });
|
|
3031
3077
|
|
|
@@ -3039,10 +3085,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.7",
|
|
|
3039
3085
|
* to this `EmptyOutletComponent`.
|
|
3040
3086
|
*/
|
|
3041
3087
|
class ɵEmptyOutletComponent {
|
|
3042
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
3043
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0-next.
|
|
3088
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3089
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0-next.9", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", exportAs: ["emptyRouterOutlet"], ngImport: i0, template: `<router-outlet/>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
3044
3090
|
}
|
|
3045
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
3091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
3046
3092
|
type: Component,
|
|
3047
3093
|
args: [{
|
|
3048
3094
|
template: `<router-outlet/>`,
|
|
@@ -3734,16 +3780,6 @@ function runCanMatchGuards(injector, route, segments, urlSerializer, abortSignal
|
|
|
3734
3780
|
return of(canMatchObservables).pipe(prioritizedGuardValue(), redirectIfUrlTree(urlSerializer));
|
|
3735
3781
|
}
|
|
3736
3782
|
|
|
3737
|
-
/** replacement for firstValueFrom in rxjs 7. We must support rxjs v6 so we cannot use it */
|
|
3738
|
-
function firstValueFrom(source) {
|
|
3739
|
-
return new Promise((resolve, reject) => {
|
|
3740
|
-
source.pipe(first()).subscribe({
|
|
3741
|
-
next: (value) => resolve(value),
|
|
3742
|
-
error: (err) => reject(err),
|
|
3743
|
-
});
|
|
3744
|
-
});
|
|
3745
|
-
}
|
|
3746
|
-
|
|
3747
3783
|
let NoMatch$1 = class NoMatch extends Error {
|
|
3748
3784
|
segmentGroup;
|
|
3749
3785
|
constructor(segmentGroup) {
|
|
@@ -4023,9 +4059,9 @@ let Recognizer$1 = class Recognizer {
|
|
|
4023
4059
|
const rootNode = new TreeNode(rootSnapshot, children);
|
|
4024
4060
|
const routeState = new RouterStateSnapshot('', rootNode);
|
|
4025
4061
|
const tree = createUrlTreeFromSnapshot(rootSnapshot, [], this.urlTree.queryParams, this.urlTree.fragment);
|
|
4026
|
-
// https://github.com/angular/angular/issues/47307
|
|
4027
4062
|
// Creating the tree stringifies the query params
|
|
4028
|
-
// We don't want to do this here
|
|
4063
|
+
// We don't want to do this here to preserve pre-existing behavior
|
|
4064
|
+
// so reassign them to the original.
|
|
4029
4065
|
tree.queryParams = this.urlTree.queryParams;
|
|
4030
4066
|
routeState.url = this.urlSerializer.serialize(tree);
|
|
4031
4067
|
return { state: routeState, tree };
|
|
@@ -4226,10 +4262,7 @@ let Recognizer$1 = class Recognizer {
|
|
|
4226
4262
|
}
|
|
4227
4263
|
const shouldLoadResult = await firstValueFrom(runCanLoadGuards(injector, route, segments, this.urlSerializer, this.abortSignal));
|
|
4228
4264
|
if (shouldLoadResult) {
|
|
4229
|
-
const cfg = await
|
|
4230
|
-
if (!cfg) {
|
|
4231
|
-
throw canLoadFails$1(route);
|
|
4232
|
-
}
|
|
4265
|
+
const cfg = await this.configLoader.loadChildren(injector, route);
|
|
4233
4266
|
route._loadedRoutes = cfg.routes;
|
|
4234
4267
|
route._loadedInjector = cfg.injector;
|
|
4235
4268
|
return cfg;
|
|
@@ -4667,7 +4700,7 @@ class Recognizer {
|
|
|
4667
4700
|
}
|
|
4668
4701
|
return runCanLoadGuards(injector, route, segments, this.urlSerializer).pipe(mergeMap((shouldLoadResult) => {
|
|
4669
4702
|
if (shouldLoadResult) {
|
|
4670
|
-
return this.configLoader.loadChildren(injector, route).pipe(tap((cfg) => {
|
|
4703
|
+
return from(this.configLoader.loadChildren(injector, route)).pipe(tap((cfg) => {
|
|
4671
4704
|
route._loadedRoutes = cfg.routes;
|
|
4672
4705
|
route._loadedInjector = cfg.injector;
|
|
4673
4706
|
}));
|
|
@@ -4899,10 +4932,10 @@ class TitleStrategy {
|
|
|
4899
4932
|
getResolvedTitleForRoute(snapshot) {
|
|
4900
4933
|
return snapshot.data[RouteTitleKey];
|
|
4901
4934
|
}
|
|
4902
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4903
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4935
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4936
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4904
4937
|
}
|
|
4905
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4938
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4906
4939
|
type: Injectable,
|
|
4907
4940
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4908
4941
|
}] });
|
|
@@ -4926,10 +4959,10 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4926
4959
|
this.title.setTitle(title);
|
|
4927
4960
|
}
|
|
4928
4961
|
}
|
|
4929
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4930
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4962
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4963
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4931
4964
|
}
|
|
4932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
4965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4933
4966
|
type: Injectable,
|
|
4934
4967
|
args: [{ providedIn: 'root' }]
|
|
4935
4968
|
}], ctorParameters: () => [{ type: i1.Title }] });
|
|
@@ -4961,28 +4994,32 @@ class RouterConfigLoader {
|
|
|
4961
4994
|
onLoadStartListener;
|
|
4962
4995
|
onLoadEndListener;
|
|
4963
4996
|
compiler = inject(Compiler);
|
|
4964
|
-
loadComponent(injector, route) {
|
|
4997
|
+
async loadComponent(injector, route) {
|
|
4965
4998
|
if (this.componentLoaders.get(route)) {
|
|
4966
4999
|
return this.componentLoaders.get(route);
|
|
4967
5000
|
}
|
|
4968
5001
|
else if (route._loadedComponent) {
|
|
4969
|
-
return
|
|
5002
|
+
return Promise.resolve(route._loadedComponent);
|
|
4970
5003
|
}
|
|
4971
5004
|
if (this.onLoadStartListener) {
|
|
4972
5005
|
this.onLoadStartListener(route);
|
|
4973
5006
|
}
|
|
4974
|
-
const
|
|
4975
|
-
|
|
4976
|
-
|
|
5007
|
+
const loader = (async () => {
|
|
5008
|
+
try {
|
|
5009
|
+
const loaded = await wrapIntoPromise(runInInjectionContext(injector, () => route.loadComponent()));
|
|
5010
|
+
const component = await maybeResolveResources(maybeUnwrapDefaultExport(loaded));
|
|
5011
|
+
if (this.onLoadEndListener) {
|
|
5012
|
+
this.onLoadEndListener(route);
|
|
5013
|
+
}
|
|
5014
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
5015
|
+
assertStandalone(route.path ?? '', component);
|
|
5016
|
+
route._loadedComponent = component;
|
|
5017
|
+
return component;
|
|
4977
5018
|
}
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
})
|
|
4982
|
-
this.componentLoaders.delete(route);
|
|
4983
|
-
}));
|
|
4984
|
-
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4985
|
-
const loader = new ConnectableObservable(loadRunner, () => new Subject()).pipe(refCount());
|
|
5019
|
+
finally {
|
|
5020
|
+
this.componentLoaders.delete(route);
|
|
5021
|
+
}
|
|
5022
|
+
})();
|
|
4986
5023
|
this.componentLoaders.set(route, loader);
|
|
4987
5024
|
return loader;
|
|
4988
5025
|
}
|
|
@@ -4991,24 +5028,29 @@ class RouterConfigLoader {
|
|
|
4991
5028
|
return this.childrenLoaders.get(route);
|
|
4992
5029
|
}
|
|
4993
5030
|
else if (route._loadedRoutes) {
|
|
4994
|
-
return
|
|
5031
|
+
return Promise.resolve({ routes: route._loadedRoutes, injector: route._loadedInjector });
|
|
4995
5032
|
}
|
|
4996
5033
|
if (this.onLoadStartListener) {
|
|
4997
5034
|
this.onLoadStartListener(route);
|
|
4998
5035
|
}
|
|
4999
|
-
const
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5036
|
+
const loader = (async () => {
|
|
5037
|
+
try {
|
|
5038
|
+
const result = await loadChildren(route, this.compiler, parentInjector, this.onLoadEndListener);
|
|
5039
|
+
route._loadedRoutes = result.routes;
|
|
5040
|
+
route._loadedInjector = result.injector;
|
|
5041
|
+
return result;
|
|
5042
|
+
}
|
|
5043
|
+
finally {
|
|
5044
|
+
this.childrenLoaders.delete(route);
|
|
5045
|
+
}
|
|
5046
|
+
})();
|
|
5005
5047
|
this.childrenLoaders.set(route, loader);
|
|
5006
5048
|
return loader;
|
|
5007
5049
|
}
|
|
5008
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5009
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5050
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5051
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
5010
5052
|
}
|
|
5011
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
5012
5054
|
type: Injectable,
|
|
5013
5055
|
args: [{ providedIn: 'root' }]
|
|
5014
5056
|
}] });
|
|
@@ -5020,40 +5062,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.7",
|
|
|
5020
5062
|
* in @angular-devkit/build-angular. If there are any updates to the contract here, it will require
|
|
5021
5063
|
* an update to the extractor.
|
|
5022
5064
|
*/
|
|
5023
|
-
function loadChildren(route, compiler, parentInjector, onLoadEndListener) {
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
}
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
}
|
|
5065
|
+
async function loadChildren(route, compiler, parentInjector, onLoadEndListener) {
|
|
5066
|
+
const loaded = await wrapIntoPromise(runInInjectionContext(parentInjector, () => route.loadChildren()));
|
|
5067
|
+
const t = await maybeResolveResources(maybeUnwrapDefaultExport(loaded));
|
|
5068
|
+
let factoryOrRoutes;
|
|
5069
|
+
if (t instanceof NgModuleFactory || Array.isArray(t)) {
|
|
5070
|
+
factoryOrRoutes = t;
|
|
5071
|
+
}
|
|
5072
|
+
else {
|
|
5073
|
+
factoryOrRoutes = await compiler.compileModuleAsync(t);
|
|
5074
|
+
}
|
|
5075
|
+
if (onLoadEndListener) {
|
|
5076
|
+
onLoadEndListener(route);
|
|
5077
|
+
}
|
|
5078
|
+
// This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is
|
|
5079
|
+
// no injector associated with lazy loading a `Route` array.
|
|
5080
|
+
let injector;
|
|
5081
|
+
let rawRoutes;
|
|
5082
|
+
let requireStandaloneComponents = false;
|
|
5083
|
+
if (Array.isArray(factoryOrRoutes)) {
|
|
5084
|
+
rawRoutes = factoryOrRoutes;
|
|
5085
|
+
requireStandaloneComponents = true;
|
|
5086
|
+
}
|
|
5087
|
+
else {
|
|
5088
|
+
injector = factoryOrRoutes.create(parentInjector).injector;
|
|
5089
|
+
// When loading a module that doesn't provide `RouterModule.forChild()` preloader
|
|
5090
|
+
// will get stuck in an infinite loop. The child module's Injector will look to
|
|
5091
|
+
// its parent `Injector` when it doesn't find any ROUTES so it will return routes
|
|
5092
|
+
// for it's parent module instead.
|
|
5093
|
+
rawRoutes = injector.get(ROUTES, [], { optional: true, self: true }).flat();
|
|
5094
|
+
}
|
|
5095
|
+
const routes = rawRoutes.map(standardizeConfig);
|
|
5096
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
5097
|
+
validateConfig(routes, route.path, requireStandaloneComponents);
|
|
5098
|
+
return { routes, injector };
|
|
5057
5099
|
}
|
|
5058
5100
|
function isWrappedDefaultExport(value) {
|
|
5059
5101
|
// We use `in` here with a string key `'default'`, because we expect `DefaultExport` objects to be
|
|
@@ -5068,7 +5110,7 @@ function maybeUnwrapDefaultExport(input) {
|
|
|
5068
5110
|
}
|
|
5069
5111
|
function maybeResolveResources(value) {
|
|
5070
5112
|
// In JIT mode we usually resolve the resources of components on bootstrap, however
|
|
5071
|
-
// that won't have happened for lazy-loaded
|
|
5113
|
+
// that won't have happened for lazy-loaded. Attempt to load any pending
|
|
5072
5114
|
// resources again here.
|
|
5073
5115
|
if ((typeof ngJitMode === 'undefined' || ngJitMode) && typeof fetch === 'function') {
|
|
5074
5116
|
return _resolveComponentResources(fetch)
|
|
@@ -5078,7 +5120,7 @@ function maybeResolveResources(value) {
|
|
|
5078
5120
|
})
|
|
5079
5121
|
.then(() => value);
|
|
5080
5122
|
}
|
|
5081
|
-
return
|
|
5123
|
+
return Promise.resolve(value);
|
|
5082
5124
|
}
|
|
5083
5125
|
|
|
5084
5126
|
/**
|
|
@@ -5089,10 +5131,10 @@ function maybeResolveResources(value) {
|
|
|
5089
5131
|
* @publicApi
|
|
5090
5132
|
*/
|
|
5091
5133
|
class UrlHandlingStrategy {
|
|
5092
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5093
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5135
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) });
|
|
5094
5136
|
}
|
|
5095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
|
|
5096
5138
|
type: Injectable,
|
|
5097
5139
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
|
|
5098
5140
|
}] });
|
|
@@ -5109,10 +5151,10 @@ class DefaultUrlHandlingStrategy {
|
|
|
5109
5151
|
merge(newUrlPart, wholeUrl) {
|
|
5110
5152
|
return newUrlPart;
|
|
5111
5153
|
}
|
|
5112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5113
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5155
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' });
|
|
5114
5156
|
}
|
|
5115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
|
|
5116
5158
|
type: Injectable,
|
|
5117
5159
|
args: [{ providedIn: 'root' }]
|
|
5118
5160
|
}] });
|
|
@@ -5409,18 +5451,24 @@ class NavigationTransitions {
|
|
|
5409
5451
|
switchTap((t) => {
|
|
5410
5452
|
const loadComponents = (route) => {
|
|
5411
5453
|
const loaders = [];
|
|
5412
|
-
if (route.routeConfig?.
|
|
5454
|
+
if (route.routeConfig?._loadedComponent) {
|
|
5455
|
+
route.component = route.routeConfig?._loadedComponent;
|
|
5456
|
+
}
|
|
5457
|
+
else if (route.routeConfig?.loadComponent) {
|
|
5413
5458
|
const injector = getClosestRouteInjector(route) ?? this.environmentInjector;
|
|
5414
|
-
loaders.push(this.configLoader
|
|
5459
|
+
loaders.push(this.configLoader
|
|
5460
|
+
.loadComponent(injector, route.routeConfig)
|
|
5461
|
+
.then((loadedComponent) => {
|
|
5415
5462
|
route.component = loadedComponent;
|
|
5416
|
-
})
|
|
5463
|
+
}));
|
|
5417
5464
|
}
|
|
5418
5465
|
for (const child of route.children) {
|
|
5419
5466
|
loaders.push(...loadComponents(child));
|
|
5420
5467
|
}
|
|
5421
5468
|
return loaders;
|
|
5422
5469
|
};
|
|
5423
|
-
|
|
5470
|
+
const loaders = loadComponents(t.targetSnapshot.root);
|
|
5471
|
+
return loaders.length === 0 ? of(t) : from(Promise.all(loaders).then(() => t));
|
|
5424
5472
|
}), switchTap(() => this.afterPreactivation()), switchMap(() => {
|
|
5425
5473
|
const { currentSnapshot, targetSnapshot } = overallTransitionState;
|
|
5426
5474
|
const viewTransitionStarted = this.createViewTransition?.(this.environmentInjector, currentSnapshot.root, targetSnapshot.root);
|
|
@@ -5587,10 +5635,10 @@ class NavigationTransitions {
|
|
|
5587
5635
|
return (currentBrowserUrl.toString() !== targetBrowserUrl?.toString() &&
|
|
5588
5636
|
!currentNavigation?.extras.skipLocationChange);
|
|
5589
5637
|
}
|
|
5590
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5591
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5639
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: NavigationTransitions, providedIn: 'root' });
|
|
5592
5640
|
}
|
|
5593
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: NavigationTransitions, decorators: [{
|
|
5594
5642
|
type: Injectable,
|
|
5595
5643
|
args: [{ providedIn: 'root' }]
|
|
5596
5644
|
}], ctorParameters: () => [] });
|
|
@@ -5606,10 +5654,10 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
5606
5654
|
* @publicApi
|
|
5607
5655
|
*/
|
|
5608
5656
|
class RouteReuseStrategy {
|
|
5609
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5610
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5657
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5658
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) });
|
|
5611
5659
|
}
|
|
5612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5660
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: RouteReuseStrategy, decorators: [{
|
|
5613
5661
|
type: Injectable,
|
|
5614
5662
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
|
|
5615
5663
|
}] });
|
|
@@ -5660,10 +5708,10 @@ class BaseRouteReuseStrategy {
|
|
|
5660
5708
|
}
|
|
5661
5709
|
}
|
|
5662
5710
|
class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
5663
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5664
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5711
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
5712
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' });
|
|
5665
5713
|
}
|
|
5666
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
|
|
5667
5715
|
type: Injectable,
|
|
5668
5716
|
args: [{ providedIn: 'root' }]
|
|
5669
5717
|
}] });
|
|
@@ -5762,10 +5810,10 @@ class StateManager {
|
|
|
5762
5810
|
// when merging, such as the query params so they are not lost on a refresh.
|
|
5763
5811
|
this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, finalUrl ?? this.rawUrlTree);
|
|
5764
5812
|
}
|
|
5765
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5766
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5813
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: StateManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5814
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: StateManager, providedIn: 'root', useFactory: () => inject(HistoryStateManager) });
|
|
5767
5815
|
}
|
|
5768
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: StateManager, decorators: [{
|
|
5769
5817
|
type: Injectable,
|
|
5770
5818
|
args: [{ providedIn: 'root', useFactory: () => inject(HistoryStateManager) }]
|
|
5771
5819
|
}] });
|
|
@@ -5897,10 +5945,10 @@ class HistoryStateManager extends StateManager {
|
|
|
5897
5945
|
}
|
|
5898
5946
|
return { navigationId };
|
|
5899
5947
|
}
|
|
5900
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5901
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: HistoryStateManager, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
5949
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: HistoryStateManager, providedIn: 'root' });
|
|
5902
5950
|
}
|
|
5903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
5951
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: HistoryStateManager, decorators: [{
|
|
5904
5952
|
type: Injectable,
|
|
5905
5953
|
args: [{ providedIn: 'root' }]
|
|
5906
5954
|
}] });
|
|
@@ -6324,7 +6372,7 @@ class Router {
|
|
|
6324
6372
|
}
|
|
6325
6373
|
relativeToUrlSegmentGroup = this.currentUrlTree.root;
|
|
6326
6374
|
}
|
|
6327
|
-
return createUrlTreeFromSegmentGroup(relativeToUrlSegmentGroup, commands, q, f ?? null);
|
|
6375
|
+
return createUrlTreeFromSegmentGroup(relativeToUrlSegmentGroup, commands, q, f ?? null, this.urlSerializer);
|
|
6328
6376
|
}
|
|
6329
6377
|
/**
|
|
6330
6378
|
* Navigates to a view using an absolute route path.
|
|
@@ -6400,7 +6448,8 @@ class Router {
|
|
|
6400
6448
|
try {
|
|
6401
6449
|
return this.urlSerializer.parse(url);
|
|
6402
6450
|
}
|
|
6403
|
-
catch {
|
|
6451
|
+
catch (e) {
|
|
6452
|
+
this.console.warn(_formatRuntimeError(4018 /* RuntimeErrorCode.ERROR_PARSING_URL */, ngDevMode && `Error parsing URL ${url}. Falling back to '/' instead. \n` + e));
|
|
6404
6453
|
return this.urlSerializer.parse('/');
|
|
6405
6454
|
}
|
|
6406
6455
|
}
|
|
@@ -6473,10 +6522,10 @@ class Router {
|
|
|
6473
6522
|
return Promise.reject(e);
|
|
6474
6523
|
});
|
|
6475
6524
|
}
|
|
6476
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
6477
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
6525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6526
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: Router, providedIn: 'root' });
|
|
6478
6527
|
}
|
|
6479
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.
|
|
6528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.9", ngImport: i0, type: Router, decorators: [{
|
|
6480
6529
|
type: Injectable,
|
|
6481
6530
|
args: [{ providedIn: 'root' }]
|
|
6482
6531
|
}], ctorParameters: () => [] });
|