@angular/router 18.0.0-next.0 → 18.0.0-next.2
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/esm2022/src/apply_redirects.mjs +16 -7
- package/esm2022/src/components/empty_outlet.mjs +3 -3
- package/esm2022/src/directives/router_link.mjs +3 -3
- package/esm2022/src/directives/router_link_active.mjs +19 -18
- package/esm2022/src/directives/router_outlet.mjs +14 -7
- package/esm2022/src/index.mjs +1 -1
- package/esm2022/src/models.mjs +1 -1
- package/esm2022/src/navigation_transition.mjs +3 -3
- package/esm2022/src/page_title_strategy.mjs +6 -6
- package/esm2022/src/recognize.mjs +36 -39
- package/esm2022/src/route_reuse_strategy.mjs +6 -6
- package/esm2022/src/router.mjs +7 -6
- package/esm2022/src/router_config_loader.mjs +3 -3
- package/esm2022/src/router_module.mjs +4 -4
- package/esm2022/src/router_outlet_context.mjs +3 -3
- package/esm2022/src/router_preloader.mjs +9 -9
- package/esm2022/src/router_scroller.mjs +3 -3
- package/esm2022/src/shared.mjs +2 -2
- package/esm2022/src/statemanager/state_manager.mjs +6 -6
- package/esm2022/src/url_handling_strategy.mjs +6 -6
- package/esm2022/src/url_tree.mjs +3 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/router_testing_harness.mjs +6 -6
- package/esm2022/testing/src/router_testing_module.mjs +4 -4
- package/fesm2022/router.mjs +147 -132
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/testing.mjs +11 -11
- package/fesm2022/upgrade.mjs +1 -1
- package/index.d.ts +25 -4
- package/package.json +4 -4
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2022/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-next.
|
|
2
|
+
* @license Angular v18.0.0-next.2
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -90,7 +90,7 @@ function defaultUrlMatcher(segments, segmentGroup, route) {
|
|
|
90
90
|
for (let index = 0; index < parts.length; index++) {
|
|
91
91
|
const part = parts[index];
|
|
92
92
|
const segment = segments[index];
|
|
93
|
-
const isParameter = part
|
|
93
|
+
const isParameter = part[0] === ':';
|
|
94
94
|
if (isParameter) {
|
|
95
95
|
posParams[part.substring(1)] = segment;
|
|
96
96
|
}
|
|
@@ -421,10 +421,10 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
421
421
|
* @publicApi
|
|
422
422
|
*/
|
|
423
423
|
class UrlSerializer {
|
|
424
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
425
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
424
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
425
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
|
|
426
426
|
}
|
|
427
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
427
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
428
428
|
type: Injectable,
|
|
429
429
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
430
430
|
}] });
|
|
@@ -1855,10 +1855,10 @@ class ChildrenOutletContexts {
|
|
|
1855
1855
|
getContext(childName) {
|
|
1856
1856
|
return this.contexts.get(childName) || null;
|
|
1857
1857
|
}
|
|
1858
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1859
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1858
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1859
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
|
|
1860
1860
|
}
|
|
1861
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
1861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
1862
1862
|
type: Injectable,
|
|
1863
1863
|
args: [{ providedIn: 'root' }]
|
|
1864
1864
|
}] });
|
|
@@ -2570,10 +2570,10 @@ class RouterOutlet {
|
|
|
2570
2570
|
this.inputBinder?.bindActivatedRouteToOutletComponent(this);
|
|
2571
2571
|
this.activateEvents.emit(this.activated.instance);
|
|
2572
2572
|
}
|
|
2573
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2574
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
2573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2574
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.2", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
|
|
2575
2575
|
}
|
|
2576
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2577
2577
|
type: Directive,
|
|
2578
2578
|
args: [{
|
|
2579
2579
|
selector: 'router-outlet',
|
|
@@ -2600,6 +2600,13 @@ class OutletInjector {
|
|
|
2600
2600
|
this.route = route;
|
|
2601
2601
|
this.childContexts = childContexts;
|
|
2602
2602
|
this.parent = parent;
|
|
2603
|
+
/**
|
|
2604
|
+
* A special flag that allows to identify the `OutletInjector` without
|
|
2605
|
+
* referring to the class itself. This is required as a temporary solution,
|
|
2606
|
+
* to have a special handling for this injector in core. Eventually, this
|
|
2607
|
+
* injector should just become an `EnvironmentInjector` without special logic.
|
|
2608
|
+
*/
|
|
2609
|
+
this.__ngOutletInjector = true;
|
|
2603
2610
|
}
|
|
2604
2611
|
get(token, notFoundValue) {
|
|
2605
2612
|
if (token === ActivatedRoute) {
|
|
@@ -2678,10 +2685,10 @@ class RoutedComponentInputBinder {
|
|
|
2678
2685
|
});
|
|
2679
2686
|
this.outletDataSubscriptions.set(outlet, dataSubscription);
|
|
2680
2687
|
}
|
|
2681
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2682
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2688
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2689
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder }); }
|
|
2683
2690
|
}
|
|
2684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
|
|
2685
2692
|
type: Injectable
|
|
2686
2693
|
}] });
|
|
2687
2694
|
|
|
@@ -2761,10 +2768,10 @@ function isNavigationCancelingError(error) {
|
|
|
2761
2768
|
* to this `EmptyOutletComponent`.
|
|
2762
2769
|
*/
|
|
2763
2770
|
class ɵEmptyOutletComponent {
|
|
2764
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2765
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
2771
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2772
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.2", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
|
|
2766
2773
|
}
|
|
2767
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
2774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2768
2775
|
type: Component,
|
|
2769
2776
|
args: [{
|
|
2770
2777
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -3555,14 +3562,23 @@ class ApplyRedirects {
|
|
|
3555
3562
|
return of(res);
|
|
3556
3563
|
}
|
|
3557
3564
|
if (c.numberOfChildren > 1 || !c.children[PRIMARY_OUTLET]) {
|
|
3558
|
-
return namedOutletsRedirect(route.redirectTo);
|
|
3565
|
+
return namedOutletsRedirect(`${route.redirectTo}`);
|
|
3559
3566
|
}
|
|
3560
3567
|
c = c.children[PRIMARY_OUTLET];
|
|
3561
3568
|
}
|
|
3562
3569
|
}
|
|
3563
|
-
applyRedirectCommands(segments, redirectTo, posParams) {
|
|
3570
|
+
applyRedirectCommands(segments, redirectTo, posParams, currentSnapshot, injector) {
|
|
3571
|
+
if (typeof redirectTo !== 'string') {
|
|
3572
|
+
const redirectToFn = redirectTo;
|
|
3573
|
+
const { queryParams, fragment, routeConfig, url, outlet, params, data, title } = currentSnapshot;
|
|
3574
|
+
const newRedirect = runInInjectionContext(injector, () => redirectToFn({ params, data, queryParams, fragment, routeConfig, url, outlet, title }));
|
|
3575
|
+
if (newRedirect instanceof UrlTree) {
|
|
3576
|
+
throw new AbsoluteRedirect(newRedirect);
|
|
3577
|
+
}
|
|
3578
|
+
redirectTo = newRedirect;
|
|
3579
|
+
}
|
|
3564
3580
|
const newTree = this.applyRedirectCreateUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
|
|
3565
|
-
if (redirectTo
|
|
3581
|
+
if (redirectTo[0] === '/') {
|
|
3566
3582
|
throw new AbsoluteRedirect(newTree);
|
|
3567
3583
|
}
|
|
3568
3584
|
return newTree;
|
|
@@ -3574,7 +3590,7 @@ class ApplyRedirects {
|
|
|
3574
3590
|
createQueryParams(redirectToParams, actualParams) {
|
|
3575
3591
|
const res = {};
|
|
3576
3592
|
Object.entries(redirectToParams).forEach(([k, v]) => {
|
|
3577
|
-
const copySourceValue = typeof v === 'string' && v
|
|
3593
|
+
const copySourceValue = typeof v === 'string' && v[0] === ':';
|
|
3578
3594
|
if (copySourceValue) {
|
|
3579
3595
|
const sourceName = v.substring(1);
|
|
3580
3596
|
res[k] = actualParams[sourceName];
|
|
@@ -3594,7 +3610,7 @@ class ApplyRedirects {
|
|
|
3594
3610
|
return new UrlSegmentGroup(updatedSegments, children);
|
|
3595
3611
|
}
|
|
3596
3612
|
createSegments(redirectTo, redirectToSegments, actualSegments, posParams) {
|
|
3597
|
-
return redirectToSegments.map((s) => s.path
|
|
3613
|
+
return redirectToSegments.map((s) => s.path[0] === ':'
|
|
3598
3614
|
? this.findPosParam(redirectTo, s, posParams)
|
|
3599
3615
|
: this.findOrReturn(s, actualSegments));
|
|
3600
3616
|
}
|
|
@@ -3785,25 +3801,25 @@ class Recognizer {
|
|
|
3785
3801
|
}
|
|
3786
3802
|
recognize() {
|
|
3787
3803
|
const rootSegmentGroup = split(this.urlTree.root, [], [], this.config).segmentGroup;
|
|
3788
|
-
return this.match(rootSegmentGroup).pipe(map((children) => {
|
|
3789
|
-
|
|
3790
|
-
// of a navigation, resulting in the router being out of sync with the browser.
|
|
3791
|
-
const root = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, {}, PRIMARY_OUTLET, this.rootComponentType, null, {});
|
|
3792
|
-
const rootNode = new TreeNode(root, children);
|
|
3804
|
+
return this.match(rootSegmentGroup).pipe(map(({ children, rootSnapshot }) => {
|
|
3805
|
+
const rootNode = new TreeNode(rootSnapshot, children);
|
|
3793
3806
|
const routeState = new RouterStateSnapshot('', rootNode);
|
|
3794
|
-
const tree = createUrlTreeFromSnapshot(
|
|
3807
|
+
const tree = createUrlTreeFromSnapshot(rootSnapshot, [], this.urlTree.queryParams, this.urlTree.fragment);
|
|
3795
3808
|
// https://github.com/angular/angular/issues/47307
|
|
3796
3809
|
// Creating the tree stringifies the query params
|
|
3797
3810
|
// We don't want to do this here so reassign them to the original.
|
|
3798
3811
|
tree.queryParams = this.urlTree.queryParams;
|
|
3799
3812
|
routeState.url = this.urlSerializer.serialize(tree);
|
|
3800
|
-
this.inheritParamsAndData(routeState._root, null);
|
|
3801
3813
|
return { state: routeState, tree };
|
|
3802
3814
|
}));
|
|
3803
3815
|
}
|
|
3804
3816
|
match(rootSegmentGroup) {
|
|
3805
|
-
|
|
3806
|
-
|
|
3817
|
+
// Use Object.freeze to prevent readers of the Router state from modifying it outside
|
|
3818
|
+
// of a navigation, resulting in the router being out of sync with the browser.
|
|
3819
|
+
const rootSnapshot = new ActivatedRouteSnapshot([], Object.freeze({}), Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, Object.freeze({}), PRIMARY_OUTLET, this.rootComponentType, null, {});
|
|
3820
|
+
return this.processSegmentGroup(this.injector, this.config, rootSegmentGroup, PRIMARY_OUTLET, rootSnapshot).pipe(map((children) => {
|
|
3821
|
+
return { children, rootSnapshot };
|
|
3822
|
+
}), catchError((e) => {
|
|
3807
3823
|
if (e instanceof AbsoluteRedirect) {
|
|
3808
3824
|
this.urlTree = e.urlTree;
|
|
3809
3825
|
return this.match(e.urlTree.root);
|
|
@@ -3814,18 +3830,11 @@ class Recognizer {
|
|
|
3814
3830
|
throw e;
|
|
3815
3831
|
}));
|
|
3816
3832
|
}
|
|
3817
|
-
|
|
3818
|
-
const route = routeNode.value;
|
|
3819
|
-
const i = getInherited(route, parent, this.paramsInheritanceStrategy);
|
|
3820
|
-
route.params = Object.freeze(i.params);
|
|
3821
|
-
route.data = Object.freeze(i.data);
|
|
3822
|
-
routeNode.children.forEach((n) => this.inheritParamsAndData(n, route));
|
|
3823
|
-
}
|
|
3824
|
-
processSegmentGroup(injector, config, segmentGroup, outlet) {
|
|
3833
|
+
processSegmentGroup(injector, config, segmentGroup, outlet, parentRoute) {
|
|
3825
3834
|
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
|
|
3826
|
-
return this.processChildren(injector, config, segmentGroup);
|
|
3835
|
+
return this.processChildren(injector, config, segmentGroup, parentRoute);
|
|
3827
3836
|
}
|
|
3828
|
-
return this.processSegment(injector, config, segmentGroup, segmentGroup.segments, outlet, true).pipe(map((child) => (child instanceof TreeNode ? [child] : [])));
|
|
3837
|
+
return this.processSegment(injector, config, segmentGroup, segmentGroup.segments, outlet, true, parentRoute).pipe(map((child) => (child instanceof TreeNode ? [child] : [])));
|
|
3829
3838
|
}
|
|
3830
3839
|
/**
|
|
3831
3840
|
* Matches every child outlet in the `segmentGroup` to a `Route` in the config. Returns `null` if
|
|
@@ -3835,7 +3844,7 @@ class Recognizer {
|
|
|
3835
3844
|
* @param segmentGroup - The `UrlSegmentGroup` whose children need to be matched against the
|
|
3836
3845
|
* config.
|
|
3837
3846
|
*/
|
|
3838
|
-
processChildren(injector, config, segmentGroup) {
|
|
3847
|
+
processChildren(injector, config, segmentGroup, parentRoute) {
|
|
3839
3848
|
// Expand outlets one at a time, starting with the primary outlet. We need to do it this way
|
|
3840
3849
|
// because an absolute redirect from the primary outlet takes precedence.
|
|
3841
3850
|
const childOutlets = [];
|
|
@@ -3853,7 +3862,7 @@ class Recognizer {
|
|
|
3853
3862
|
// appear first, followed by routes for other outlets, which might match if they have
|
|
3854
3863
|
// an empty path.
|
|
3855
3864
|
const sortedConfig = sortByMatchingOutlets(config, childOutlet);
|
|
3856
|
-
return this.processSegmentGroup(injector, sortedConfig, child, childOutlet);
|
|
3865
|
+
return this.processSegmentGroup(injector, sortedConfig, child, childOutlet, parentRoute);
|
|
3857
3866
|
}), scan((children, outletChildren) => {
|
|
3858
3867
|
children.push(...outletChildren);
|
|
3859
3868
|
return children;
|
|
@@ -3873,9 +3882,9 @@ class Recognizer {
|
|
|
3873
3882
|
return of(mergedChildren);
|
|
3874
3883
|
}));
|
|
3875
3884
|
}
|
|
3876
|
-
processSegment(injector, routes, segmentGroup, segments, outlet, allowRedirects) {
|
|
3885
|
+
processSegment(injector, routes, segmentGroup, segments, outlet, allowRedirects, parentRoute) {
|
|
3877
3886
|
return from(routes).pipe(concatMap((r) => {
|
|
3878
|
-
return this.processSegmentAgainstRoute(r._injector ?? injector, routes, r, segmentGroup, segments, outlet, allowRedirects).pipe(catchError((e) => {
|
|
3887
|
+
return this.processSegmentAgainstRoute(r._injector ?? injector, routes, r, segmentGroup, segments, outlet, allowRedirects, parentRoute).pipe(catchError((e) => {
|
|
3879
3888
|
if (e instanceof NoMatch) {
|
|
3880
3889
|
return of(null);
|
|
3881
3890
|
}
|
|
@@ -3891,24 +3900,24 @@ class Recognizer {
|
|
|
3891
3900
|
throw e;
|
|
3892
3901
|
}));
|
|
3893
3902
|
}
|
|
3894
|
-
processSegmentAgainstRoute(injector, routes, route, rawSegment, segments, outlet, allowRedirects) {
|
|
3903
|
+
processSegmentAgainstRoute(injector, routes, route, rawSegment, segments, outlet, allowRedirects, parentRoute) {
|
|
3895
3904
|
if (!isImmediateMatch(route, rawSegment, segments, outlet))
|
|
3896
3905
|
return noMatch$1(rawSegment);
|
|
3897
3906
|
if (route.redirectTo === undefined) {
|
|
3898
|
-
return this.matchSegmentAgainstRoute(injector, rawSegment, route, segments, outlet);
|
|
3907
|
+
return this.matchSegmentAgainstRoute(injector, rawSegment, route, segments, outlet, parentRoute);
|
|
3899
3908
|
}
|
|
3900
3909
|
if (this.allowRedirects && allowRedirects) {
|
|
3901
|
-
return this.expandSegmentAgainstRouteUsingRedirect(injector, rawSegment, routes, route, segments, outlet);
|
|
3910
|
+
return this.expandSegmentAgainstRouteUsingRedirect(injector, rawSegment, routes, route, segments, outlet, parentRoute);
|
|
3902
3911
|
}
|
|
3903
3912
|
return noMatch$1(rawSegment);
|
|
3904
3913
|
}
|
|
3905
|
-
expandSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, segments, outlet) {
|
|
3906
|
-
const { matched, consumedSegments, positionalParamSegments, remainingSegments } = match(segmentGroup, route, segments);
|
|
3914
|
+
expandSegmentAgainstRouteUsingRedirect(injector, segmentGroup, routes, route, segments, outlet, parentRoute) {
|
|
3915
|
+
const { matched, parameters, consumedSegments, positionalParamSegments, remainingSegments } = match(segmentGroup, route, segments);
|
|
3907
3916
|
if (!matched)
|
|
3908
3917
|
return noMatch$1(segmentGroup);
|
|
3909
3918
|
// TODO(atscott): Move all of this under an if(ngDevMode) as a breaking change and allow stack
|
|
3910
3919
|
// size exceeded in production
|
|
3911
|
-
if (route.redirectTo.
|
|
3920
|
+
if (typeof route.redirectTo === 'string' && route.redirectTo[0] === '/') {
|
|
3912
3921
|
this.absoluteRedirectCount++;
|
|
3913
3922
|
if (this.absoluteRedirectCount > MAX_ALLOWED_REDIRECTS) {
|
|
3914
3923
|
if (ngDevMode) {
|
|
@@ -3919,12 +3928,16 @@ class Recognizer {
|
|
|
3919
3928
|
this.allowRedirects = false;
|
|
3920
3929
|
}
|
|
3921
3930
|
}
|
|
3922
|
-
const
|
|
3931
|
+
const currentSnapshot = new ActivatedRouteSnapshot(segments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getResolve(route));
|
|
3932
|
+
const inherited = getInherited(currentSnapshot, parentRoute, this.paramsInheritanceStrategy);
|
|
3933
|
+
currentSnapshot.params = Object.freeze(inherited.params);
|
|
3934
|
+
currentSnapshot.data = Object.freeze(inherited.data);
|
|
3935
|
+
const newTree = this.applyRedirects.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments, currentSnapshot, injector);
|
|
3923
3936
|
return this.applyRedirects.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
|
|
3924
|
-
return this.processSegment(injector, routes, segmentGroup, newSegments.concat(remainingSegments), outlet, false);
|
|
3937
|
+
return this.processSegment(injector, routes, segmentGroup, newSegments.concat(remainingSegments), outlet, false, parentRoute);
|
|
3925
3938
|
}));
|
|
3926
3939
|
}
|
|
3927
|
-
matchSegmentAgainstRoute(injector, rawSegment, route, segments, outlet) {
|
|
3940
|
+
matchSegmentAgainstRoute(injector, rawSegment, route, segments, outlet, parentRoute) {
|
|
3928
3941
|
const matchResult = matchWithChecks(rawSegment, route, segments, injector, this.urlSerializer);
|
|
3929
3942
|
if (route.path === '**') {
|
|
3930
3943
|
// Prior versions of the route matching algorithm would stop matching at the wildcard route.
|
|
@@ -3941,14 +3954,14 @@ class Recognizer {
|
|
|
3941
3954
|
injector = route._injector ?? injector;
|
|
3942
3955
|
return this.getChildConfig(injector, route, segments).pipe(switchMap(({ routes: childConfig }) => {
|
|
3943
3956
|
const childInjector = route._loadedInjector ?? injector;
|
|
3944
|
-
const { consumedSegments, remainingSegments
|
|
3957
|
+
const { parameters, consumedSegments, remainingSegments } = result;
|
|
3945
3958
|
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getResolve(route));
|
|
3959
|
+
const inherited = getInherited(snapshot, parentRoute, this.paramsInheritanceStrategy);
|
|
3960
|
+
snapshot.params = Object.freeze(inherited.params);
|
|
3961
|
+
snapshot.data = Object.freeze(inherited.data);
|
|
3946
3962
|
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments, childConfig);
|
|
3947
3963
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
3948
|
-
return this.processChildren(childInjector, childConfig, segmentGroup).pipe(map((children) => {
|
|
3949
|
-
if (children === null) {
|
|
3950
|
-
return null;
|
|
3951
|
-
}
|
|
3964
|
+
return this.processChildren(childInjector, childConfig, segmentGroup, snapshot).pipe(map((children) => {
|
|
3952
3965
|
return new TreeNode(snapshot, children);
|
|
3953
3966
|
}));
|
|
3954
3967
|
}
|
|
@@ -3964,7 +3977,7 @@ class Recognizer {
|
|
|
3964
3977
|
// {path: 'c', component: C},
|
|
3965
3978
|
// ]}
|
|
3966
3979
|
// Notice that the children of the named outlet are configured with the primary outlet
|
|
3967
|
-
return this.processSegment(childInjector, childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet, true).pipe(map((child) => {
|
|
3980
|
+
return this.processSegment(childInjector, childConfig, segmentGroup, slicedSegments, matchedOnOutlet ? PRIMARY_OUTLET : outlet, true, snapshot).pipe(map((child) => {
|
|
3968
3981
|
return new TreeNode(snapshot, child instanceof TreeNode ? [child] : []);
|
|
3969
3982
|
}));
|
|
3970
3983
|
}));
|
|
@@ -4194,10 +4207,10 @@ class TitleStrategy {
|
|
|
4194
4207
|
getResolvedTitleForRoute(snapshot) {
|
|
4195
4208
|
return snapshot.data[RouteTitleKey];
|
|
4196
4209
|
}
|
|
4197
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4198
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4210
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4211
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
|
|
4199
4212
|
}
|
|
4200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4201
4214
|
type: Injectable,
|
|
4202
4215
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4203
4216
|
}] });
|
|
@@ -4220,10 +4233,10 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4220
4233
|
this.title.setTitle(title);
|
|
4221
4234
|
}
|
|
4222
4235
|
}
|
|
4223
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4224
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4236
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4237
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
|
|
4225
4238
|
}
|
|
4226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4227
4240
|
type: Injectable,
|
|
4228
4241
|
args: [{ providedIn: 'root' }]
|
|
4229
4242
|
}], ctorParameters: () => [{ type: i1.Title }] });
|
|
@@ -4299,10 +4312,10 @@ class RouterConfigLoader {
|
|
|
4299
4312
|
this.childrenLoaders.set(route, loader);
|
|
4300
4313
|
return loader;
|
|
4301
4314
|
}
|
|
4302
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4303
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4316
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
|
|
4304
4317
|
}
|
|
4305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4306
4319
|
type: Injectable,
|
|
4307
4320
|
args: [{ providedIn: 'root' }]
|
|
4308
4321
|
}] });
|
|
@@ -4369,10 +4382,10 @@ function maybeUnwrapDefaultExport(input) {
|
|
|
4369
4382
|
* @publicApi
|
|
4370
4383
|
*/
|
|
4371
4384
|
class UrlHandlingStrategy {
|
|
4372
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4373
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4385
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4386
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
|
|
4374
4387
|
}
|
|
4375
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
|
|
4376
4389
|
type: Injectable,
|
|
4377
4390
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
|
|
4378
4391
|
}] });
|
|
@@ -4389,10 +4402,10 @@ class DefaultUrlHandlingStrategy {
|
|
|
4389
4402
|
merge(newUrlPart, wholeUrl) {
|
|
4390
4403
|
return newUrlPart;
|
|
4391
4404
|
}
|
|
4392
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4393
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4405
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4406
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
|
|
4394
4407
|
}
|
|
4395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
|
|
4396
4409
|
type: Injectable,
|
|
4397
4410
|
args: [{ providedIn: 'root' }]
|
|
4398
4411
|
}] });
|
|
@@ -4823,10 +4836,10 @@ class NavigationTransitions {
|
|
|
4823
4836
|
return (extractedBrowserUrl.toString() !== this.currentTransition?.extractedUrl.toString() &&
|
|
4824
4837
|
!this.currentTransition?.extras.skipLocationChange);
|
|
4825
4838
|
}
|
|
4826
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4827
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4839
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4840
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
|
|
4828
4841
|
}
|
|
4829
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NavigationTransitions, decorators: [{
|
|
4830
4843
|
type: Injectable,
|
|
4831
4844
|
args: [{ providedIn: 'root' }]
|
|
4832
4845
|
}], ctorParameters: () => [] });
|
|
@@ -4842,10 +4855,10 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
4842
4855
|
* @publicApi
|
|
4843
4856
|
*/
|
|
4844
4857
|
class RouteReuseStrategy {
|
|
4845
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4846
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4858
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4859
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
|
|
4847
4860
|
}
|
|
4848
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, decorators: [{
|
|
4849
4862
|
type: Injectable,
|
|
4850
4863
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
|
|
4851
4864
|
}] });
|
|
@@ -4896,19 +4909,19 @@ class BaseRouteReuseStrategy {
|
|
|
4896
4909
|
}
|
|
4897
4910
|
}
|
|
4898
4911
|
class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
4899
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4900
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4912
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4913
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
|
|
4901
4914
|
}
|
|
4902
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
|
|
4903
4916
|
type: Injectable,
|
|
4904
4917
|
args: [{ providedIn: 'root' }]
|
|
4905
4918
|
}] });
|
|
4906
4919
|
|
|
4907
4920
|
class StateManager {
|
|
4908
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4909
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4921
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: StateManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4922
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: StateManager, providedIn: 'root', useFactory: () => inject(HistoryStateManager) }); }
|
|
4910
4923
|
}
|
|
4911
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
4924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: StateManager, decorators: [{
|
|
4912
4925
|
type: Injectable,
|
|
4913
4926
|
args: [{ providedIn: 'root', useFactory: () => inject(HistoryStateManager) }]
|
|
4914
4927
|
}] });
|
|
@@ -5083,10 +5096,10 @@ class HistoryStateManager extends StateManager {
|
|
|
5083
5096
|
}
|
|
5084
5097
|
return { navigationId };
|
|
5085
5098
|
}
|
|
5086
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5087
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5099
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: HistoryStateManager, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5100
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: HistoryStateManager, providedIn: 'root' }); }
|
|
5088
5101
|
}
|
|
5089
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: HistoryStateManager, decorators: [{
|
|
5090
5103
|
type: Injectable,
|
|
5091
5104
|
args: [{ providedIn: 'root' }]
|
|
5092
5105
|
}] });
|
|
@@ -5281,7 +5294,8 @@ class Router {
|
|
|
5281
5294
|
// updates or if the navigation was triggered by the browser (back
|
|
5282
5295
|
// button, URL bar, etc). We want to replace that item in history
|
|
5283
5296
|
// if the navigation is rejected.
|
|
5284
|
-
replaceUrl:
|
|
5297
|
+
replaceUrl: currentTransition.extras.replaceUrl ||
|
|
5298
|
+
this.urlUpdateStrategy === 'eager' ||
|
|
5285
5299
|
isBrowserTriggeredNavigation(currentTransition.source),
|
|
5286
5300
|
// allow developer to override default options with RedirectCommand
|
|
5287
5301
|
...opts,
|
|
@@ -5499,7 +5513,7 @@ class Router {
|
|
|
5499
5513
|
// Note: the difference between having this fallback for invalid `ActivatedRoute` setups and
|
|
5500
5514
|
// just throwing is ~500 test failures. Fixing all of those tests by hand is not feasible at
|
|
5501
5515
|
// the moment.
|
|
5502
|
-
if (typeof commands[0] !== 'string' ||
|
|
5516
|
+
if (typeof commands[0] !== 'string' || commands[0][0] !== '/') {
|
|
5503
5517
|
// Navigations that were absolute in the old way of creating UrlTrees
|
|
5504
5518
|
// would still work because they wouldn't attempt to match the
|
|
5505
5519
|
// segments in the `ActivatedRoute` to the `currentUrlTree` but
|
|
@@ -5665,10 +5679,10 @@ class Router {
|
|
|
5665
5679
|
return Promise.reject(e);
|
|
5666
5680
|
});
|
|
5667
5681
|
}
|
|
5668
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5669
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5682
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5683
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: Router, providedIn: 'root' }); }
|
|
5670
5684
|
}
|
|
5671
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: Router, decorators: [{
|
|
5672
5686
|
type: Injectable,
|
|
5673
5687
|
args: [{ providedIn: 'root' }]
|
|
5674
5688
|
}], ctorParameters: () => [] });
|
|
@@ -5943,10 +5957,10 @@ class RouterLink {
|
|
|
5943
5957
|
preserveFragment: this.preserveFragment,
|
|
5944
5958
|
});
|
|
5945
5959
|
}
|
|
5946
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5947
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.
|
|
5960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5961
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.2", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", info: "info", relativeTo: "relativeTo", preserveFragment: ["preserveFragment", "preserveFragment", booleanAttribute], skipLocationChange: ["skipLocationChange", "skipLocationChange", booleanAttribute], replaceUrl: ["replaceUrl", "replaceUrl", booleanAttribute], routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
5948
5962
|
}
|
|
5949
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
5963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterLink, decorators: [{
|
|
5950
5964
|
type: Directive,
|
|
5951
5965
|
args: [{
|
|
5952
5966
|
selector: '[routerLink]',
|
|
@@ -6147,23 +6161,24 @@ class RouterLinkActive {
|
|
|
6147
6161
|
return;
|
|
6148
6162
|
queueMicrotask(() => {
|
|
6149
6163
|
const hasActiveLinks = this.hasActiveLinks();
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
this.classes.forEach((c) => {
|
|
6154
|
-
if (hasActiveLinks) {
|
|
6155
|
-
this.renderer.addClass(this.element.nativeElement, c);
|
|
6156
|
-
}
|
|
6157
|
-
else {
|
|
6158
|
-
this.renderer.removeClass(this.element.nativeElement, c);
|
|
6159
|
-
}
|
|
6160
|
-
});
|
|
6161
|
-
if (hasActiveLinks && this.ariaCurrentWhenActive !== undefined) {
|
|
6162
|
-
this.renderer.setAttribute(this.element.nativeElement, 'aria-current', this.ariaCurrentWhenActive.toString());
|
|
6164
|
+
this.classes.forEach((c) => {
|
|
6165
|
+
if (hasActiveLinks) {
|
|
6166
|
+
this.renderer.addClass(this.element.nativeElement, c);
|
|
6163
6167
|
}
|
|
6164
6168
|
else {
|
|
6165
|
-
this.renderer.
|
|
6169
|
+
this.renderer.removeClass(this.element.nativeElement, c);
|
|
6166
6170
|
}
|
|
6171
|
+
});
|
|
6172
|
+
if (hasActiveLinks && this.ariaCurrentWhenActive !== undefined) {
|
|
6173
|
+
this.renderer.setAttribute(this.element.nativeElement, 'aria-current', this.ariaCurrentWhenActive.toString());
|
|
6174
|
+
}
|
|
6175
|
+
else {
|
|
6176
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-current');
|
|
6177
|
+
}
|
|
6178
|
+
// Only emit change if the active state changed.
|
|
6179
|
+
if (this._isActive !== hasActiveLinks) {
|
|
6180
|
+
this._isActive = hasActiveLinks;
|
|
6181
|
+
this.cdr.markForCheck();
|
|
6167
6182
|
// Emit on isActiveChange after classes are updated
|
|
6168
6183
|
this.isActiveChange.emit(hasActiveLinks);
|
|
6169
6184
|
}
|
|
@@ -6183,10 +6198,10 @@ class RouterLinkActive {
|
|
|
6183
6198
|
const isActiveCheckFn = this.isLinkActive(this.router);
|
|
6184
6199
|
return (this.link && isActiveCheckFn(this.link)) || this.links.some(isActiveCheckFn);
|
|
6185
6200
|
}
|
|
6186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6187
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
6201
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6202
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.2", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 }); }
|
|
6188
6203
|
}
|
|
6189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
6190
6205
|
type: Directive,
|
|
6191
6206
|
args: [{
|
|
6192
6207
|
selector: '[routerLinkActive]',
|
|
@@ -6238,10 +6253,10 @@ class PreloadAllModules {
|
|
|
6238
6253
|
preload(route, fn) {
|
|
6239
6254
|
return fn().pipe(catchError(() => of(null)));
|
|
6240
6255
|
}
|
|
6241
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6242
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6257
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
|
|
6243
6258
|
}
|
|
6244
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6245
6260
|
type: Injectable,
|
|
6246
6261
|
args: [{ providedIn: 'root' }]
|
|
6247
6262
|
}] });
|
|
@@ -6258,10 +6273,10 @@ class NoPreloading {
|
|
|
6258
6273
|
preload(route, fn) {
|
|
6259
6274
|
return of(null);
|
|
6260
6275
|
}
|
|
6261
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6262
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6276
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6277
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
|
|
6263
6278
|
}
|
|
6264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6265
6280
|
type: Injectable,
|
|
6266
6281
|
args: [{ providedIn: 'root' }]
|
|
6267
6282
|
}] });
|
|
@@ -6352,10 +6367,10 @@ class RouterPreloader {
|
|
|
6352
6367
|
}
|
|
6353
6368
|
});
|
|
6354
6369
|
}
|
|
6355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6356
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6371
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
|
|
6357
6372
|
}
|
|
6358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6359
6374
|
type: Injectable,
|
|
6360
6375
|
args: [{ providedIn: 'root' }]
|
|
6361
6376
|
}], ctorParameters: () => [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }] });
|
|
@@ -6448,10 +6463,10 @@ class RouterScroller {
|
|
|
6448
6463
|
this.routerEventsSubscription?.unsubscribe();
|
|
6449
6464
|
this.scrollEventsSubscription?.unsubscribe();
|
|
6450
6465
|
}
|
|
6451
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6452
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6466
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6467
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterScroller }); }
|
|
6453
6468
|
}
|
|
6454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
6469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6455
6470
|
type: Injectable
|
|
6456
6471
|
}], ctorParameters: () => [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }] });
|
|
6457
6472
|
|
|
@@ -7101,11 +7116,11 @@ class RouterModule {
|
|
|
7101
7116
|
providers: [{ provide: ROUTES, multi: true, useValue: routes }],
|
|
7102
7117
|
};
|
|
7103
7118
|
}
|
|
7104
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
7105
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.
|
|
7106
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
7119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7120
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
|
|
7121
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterModule }); }
|
|
7107
7122
|
}
|
|
7108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.
|
|
7123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.2", ngImport: i0, type: RouterModule, decorators: [{
|
|
7109
7124
|
type: NgModule,
|
|
7110
7125
|
args: [{
|
|
7111
7126
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -7250,7 +7265,7 @@ function mapToResolve(provider) {
|
|
|
7250
7265
|
/**
|
|
7251
7266
|
* @publicApi
|
|
7252
7267
|
*/
|
|
7253
|
-
const VERSION = new Version('18.0.0-next.
|
|
7268
|
+
const VERSION = new Version('18.0.0-next.2');
|
|
7254
7269
|
|
|
7255
7270
|
/**
|
|
7256
7271
|
* @module
|