@angular/router 14.0.0-next.0 → 14.0.0-next.11
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/esm2020/src/apply_redirects.mjs +12 -13
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/create_url_tree.mjs +8 -7
- package/esm2020/src/directives/router_link.mjs +15 -18
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +4 -4
- package/esm2020/src/events.mjs +1 -1
- package/esm2020/src/index.mjs +2 -1
- package/esm2020/src/models.mjs +14 -0
- package/esm2020/src/operators/activate_routes.mjs +1 -1
- package/esm2020/src/operators/apply_redirects.mjs +1 -1
- package/esm2020/src/operators/check_guards.mjs +1 -1
- package/esm2020/src/operators/recognize.mjs +1 -1
- package/esm2020/src/operators/resolve_data.mjs +20 -7
- package/esm2020/src/page_title_strategy.mjs +84 -0
- package/esm2020/src/private_export.mjs +1 -1
- package/esm2020/src/recognize.mjs +4 -4
- package/esm2020/src/router.mjs +9 -20
- package/esm2020/src/router_config_loader.mjs +2 -2
- package/esm2020/src/router_module.mjs +13 -11
- package/esm2020/src/router_preloader.mjs +4 -4
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/router_state.mjs +2 -2
- package/esm2020/src/shared.mjs +1 -1
- package/esm2020/src/url_tree.mjs +2 -2
- package/esm2020/src/utils/config.mjs +1 -4
- package/esm2020/src/utils/config_matching.mjs +4 -4
- package/esm2020/src/utils/preactivation.mjs +1 -1
- package/esm2020/src/utils/type_guards.mjs +1 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +39 -15
- package/esm2020/upgrade/src/upgrade.mjs +15 -5
- package/fesm2015/router.mjs +179 -97
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +40 -16
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +16 -5
- package/fesm2015/upgrade.mjs.map +1 -1
- package/fesm2020/router.mjs +173 -97
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +40 -16
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +15 -5
- package/fesm2020/upgrade.mjs.map +1 -1
- package/package.json +5 -5
- package/router.d.ts +104 -9
- package/testing/testing.d.ts +10 -2
- package/upgrade/upgrade.d.ts +1 -1
- package/esm2020/src/config.mjs +0 -14
- package/esm2020/src/interfaces.mjs +0 -9
package/fesm2020/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.11
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
import * as i3 from '@angular/common';
|
|
8
8
|
import { Location, LocationStrategy, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';
|
|
11
|
-
import { from, of, BehaviorSubject, combineLatest,
|
|
10
|
+
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, NgModuleRef, InjectionToken, InjectFlags, NgModuleFactory, ɵConsole, NgZone, Injectable, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, ApplicationRef, Version } from '@angular/core';
|
|
11
|
+
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
12
12
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, refCount, finalize, mergeAll } from 'rxjs/operators';
|
|
13
|
+
import * as i1 from '@angular/platform-browser';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @license
|
|
@@ -1130,7 +1131,7 @@ class UrlParser {
|
|
|
1130
1131
|
}
|
|
1131
1132
|
let outletName = undefined;
|
|
1132
1133
|
if (path.indexOf(':') > -1) {
|
|
1133
|
-
outletName = path.
|
|
1134
|
+
outletName = path.slice(0, path.indexOf(':'));
|
|
1134
1135
|
this.capture(outletName);
|
|
1135
1136
|
this.capture(':');
|
|
1136
1137
|
}
|
|
@@ -1455,7 +1456,7 @@ function flattenInherited(pathFromRoot) {
|
|
|
1455
1456
|
return pathFromRoot.reduce((res, curr) => {
|
|
1456
1457
|
const params = { ...res.params, ...curr.params };
|
|
1457
1458
|
const data = { ...res.data, ...curr.data };
|
|
1458
|
-
const resolve = { ...res.resolve, ...curr._resolvedData };
|
|
1459
|
+
const resolve = { ...curr.data, ...res.resolve, ...curr.routeConfig?.data, ...curr._resolvedData };
|
|
1459
1460
|
return { params, data, resolve };
|
|
1460
1461
|
}, { params: {}, data: {}, resolve: {} });
|
|
1461
1462
|
}
|
|
@@ -1712,17 +1713,17 @@ function createActivatedRoute(c) {
|
|
|
1712
1713
|
*/
|
|
1713
1714
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
1714
1715
|
if (commands.length === 0) {
|
|
1715
|
-
return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);
|
|
1716
|
+
return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment);
|
|
1716
1717
|
}
|
|
1717
1718
|
const nav = computeNavigation(commands);
|
|
1718
1719
|
if (nav.toRoot()) {
|
|
1719
|
-
return tree(urlTree.root, new UrlSegmentGroup([], {}),
|
|
1720
|
+
return tree(urlTree.root, urlTree.root, new UrlSegmentGroup([], {}), queryParams, fragment);
|
|
1720
1721
|
}
|
|
1721
1722
|
const startingPosition = findStartingPosition(nav, urlTree, route);
|
|
1722
1723
|
const segmentGroup = startingPosition.processChildren ?
|
|
1723
1724
|
updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :
|
|
1724
1725
|
updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);
|
|
1725
|
-
return tree(startingPosition.segmentGroup, segmentGroup,
|
|
1726
|
+
return tree(urlTree.root, startingPosition.segmentGroup, segmentGroup, queryParams, fragment);
|
|
1726
1727
|
}
|
|
1727
1728
|
function isMatrixParams(command) {
|
|
1728
1729
|
return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
|
|
@@ -1734,17 +1735,18 @@ function isMatrixParams(command) {
|
|
|
1734
1735
|
function isCommandWithOutlets(command) {
|
|
1735
1736
|
return typeof command === 'object' && command != null && command.outlets;
|
|
1736
1737
|
}
|
|
1737
|
-
function tree(oldSegmentGroup, newSegmentGroup,
|
|
1738
|
+
function tree(oldRoot, oldSegmentGroup, newSegmentGroup, queryParams, fragment) {
|
|
1738
1739
|
let qp = {};
|
|
1739
1740
|
if (queryParams) {
|
|
1740
1741
|
forEach(queryParams, (value, name) => {
|
|
1741
1742
|
qp[name] = Array.isArray(value) ? value.map((v) => `${v}`) : `${value}`;
|
|
1742
1743
|
});
|
|
1743
1744
|
}
|
|
1744
|
-
if (
|
|
1745
|
+
if (oldRoot === oldSegmentGroup) {
|
|
1745
1746
|
return new UrlTree(newSegmentGroup, qp, fragment);
|
|
1746
1747
|
}
|
|
1747
|
-
|
|
1748
|
+
const newRoot = replaceSegment(oldRoot, oldSegmentGroup, newSegmentGroup);
|
|
1749
|
+
return new UrlTree(newRoot, qp, fragment);
|
|
1748
1750
|
}
|
|
1749
1751
|
function replaceSegment(current, oldSegment, newSegment) {
|
|
1750
1752
|
const children = {};
|
|
@@ -2524,9 +2526,9 @@ class RouterOutlet {
|
|
|
2524
2526
|
this.activateEvents.emit(this.activated.instance);
|
|
2525
2527
|
}
|
|
2526
2528
|
}
|
|
2527
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2528
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2529
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2530
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.11", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2530
2532
|
type: Directive,
|
|
2531
2533
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2532
2534
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }, { type: undefined, decorators: [{
|
|
@@ -2580,9 +2582,9 @@ class OutletInjector {
|
|
|
2580
2582
|
*/
|
|
2581
2583
|
class ɵEmptyOutletComponent {
|
|
2582
2584
|
}
|
|
2583
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2584
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2585
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2586
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.11", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, directives: [{ type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2586
2588
|
type: Component,
|
|
2587
2589
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2588
2590
|
}] });
|
|
@@ -2656,9 +2658,6 @@ function validateNode(route, fullPath) {
|
|
|
2656
2658
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2657
2659
|
throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2658
2660
|
}
|
|
2659
|
-
if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
|
|
2660
|
-
throw new Error(`Invalid configuration of route '${fullPath}': pathMatch can only be set to 'prefix' or 'full'`);
|
|
2661
|
-
}
|
|
2662
2661
|
}
|
|
2663
2662
|
if (route.children) {
|
|
2664
2663
|
validateConfig(route.children, fullPath);
|
|
@@ -2716,7 +2715,7 @@ function sortByMatchingOutlets(routes, outletName) {
|
|
|
2716
2715
|
const noMatch$1 = {
|
|
2717
2716
|
matched: false,
|
|
2718
2717
|
consumedSegments: [],
|
|
2719
|
-
|
|
2718
|
+
remainingSegments: [],
|
|
2720
2719
|
parameters: {},
|
|
2721
2720
|
positionalParamSegments: {}
|
|
2722
2721
|
};
|
|
@@ -2728,7 +2727,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2728
2727
|
return {
|
|
2729
2728
|
matched: true,
|
|
2730
2729
|
consumedSegments: [],
|
|
2731
|
-
|
|
2730
|
+
remainingSegments: segments,
|
|
2732
2731
|
parameters: {},
|
|
2733
2732
|
positionalParamSegments: {}
|
|
2734
2733
|
};
|
|
@@ -2747,7 +2746,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2747
2746
|
return {
|
|
2748
2747
|
matched: true,
|
|
2749
2748
|
consumedSegments: res.consumed,
|
|
2750
|
-
|
|
2749
|
+
remainingSegments: segments.slice(res.consumed.length),
|
|
2751
2750
|
// TODO(atscott): investigate combining parameters and positionalParamSegments
|
|
2752
2751
|
parameters,
|
|
2753
2752
|
positionalParamSegments: res.posParams ?? {}
|
|
@@ -2865,16 +2864,16 @@ class AbsoluteRedirect {
|
|
|
2865
2864
|
}
|
|
2866
2865
|
}
|
|
2867
2866
|
function noMatch(segmentGroup) {
|
|
2868
|
-
return
|
|
2867
|
+
return throwError(new NoMatch$1(segmentGroup));
|
|
2869
2868
|
}
|
|
2870
2869
|
function absoluteRedirect(newTree) {
|
|
2871
|
-
return
|
|
2870
|
+
return throwError(new AbsoluteRedirect(newTree));
|
|
2872
2871
|
}
|
|
2873
2872
|
function namedOutletsRedirect(redirectTo) {
|
|
2874
|
-
return
|
|
2873
|
+
return throwError(new Error(`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
2875
2874
|
}
|
|
2876
2875
|
function canLoadFails(route) {
|
|
2877
|
-
return
|
|
2876
|
+
return throwError(navigationCancelingError(`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
|
|
2878
2877
|
}
|
|
2879
2878
|
/**
|
|
2880
2879
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -2989,7 +2988,7 @@ class ApplyRedirects {
|
|
|
2989
2988
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
2990
2989
|
return of(new UrlSegmentGroup([], {}));
|
|
2991
2990
|
}
|
|
2992
|
-
|
|
2991
|
+
return noMatch(segmentGroup);
|
|
2993
2992
|
}
|
|
2994
2993
|
throw e;
|
|
2995
2994
|
}));
|
|
@@ -3023,7 +3022,7 @@ class ApplyRedirects {
|
|
|
3023
3022
|
}));
|
|
3024
3023
|
}
|
|
3025
3024
|
expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
|
|
3026
|
-
const { matched, consumedSegments,
|
|
3025
|
+
const { matched, consumedSegments, remainingSegments, positionalParamSegments } = match(segmentGroup, route, segments);
|
|
3027
3026
|
if (!matched)
|
|
3028
3027
|
return noMatch(segmentGroup);
|
|
3029
3028
|
const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
|
|
@@ -3031,7 +3030,7 @@ class ApplyRedirects {
|
|
|
3031
3030
|
return absoluteRedirect(newTree);
|
|
3032
3031
|
}
|
|
3033
3032
|
return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
|
|
3034
|
-
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(
|
|
3033
|
+
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(remainingSegments), outlet, false);
|
|
3035
3034
|
}));
|
|
3036
3035
|
}
|
|
3037
3036
|
matchSegmentAgainstRoute(ngModule, rawSegmentGroup, route, segments, outlet) {
|
|
@@ -3046,15 +3045,14 @@ class ApplyRedirects {
|
|
|
3046
3045
|
}
|
|
3047
3046
|
return of(new UrlSegmentGroup(segments, {}));
|
|
3048
3047
|
}
|
|
3049
|
-
const { matched, consumedSegments,
|
|
3048
|
+
const { matched, consumedSegments, remainingSegments } = match(rawSegmentGroup, route, segments);
|
|
3050
3049
|
if (!matched)
|
|
3051
3050
|
return noMatch(rawSegmentGroup);
|
|
3052
|
-
const rawSlicedSegments = segments.slice(lastChild);
|
|
3053
3051
|
const childConfig$ = this.getChildConfig(ngModule, route, segments);
|
|
3054
3052
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
3055
3053
|
const childModule = routerConfig.module;
|
|
3056
3054
|
const childConfig = routerConfig.routes;
|
|
3057
|
-
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments,
|
|
3055
|
+
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments, remainingSegments, childConfig);
|
|
3058
3056
|
// See comment on the other call to `split` about why this is necessary.
|
|
3059
3057
|
const segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);
|
|
3060
3058
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
@@ -3631,7 +3629,7 @@ class Recognizer {
|
|
|
3631
3629
|
return null;
|
|
3632
3630
|
let snapshot;
|
|
3633
3631
|
let consumedSegments = [];
|
|
3634
|
-
let
|
|
3632
|
+
let remainingSegments = [];
|
|
3635
3633
|
if (route.path === '**') {
|
|
3636
3634
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
3637
3635
|
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
|
|
@@ -3642,11 +3640,11 @@ class Recognizer {
|
|
|
3642
3640
|
return null;
|
|
3643
3641
|
}
|
|
3644
3642
|
consumedSegments = result.consumedSegments;
|
|
3645
|
-
|
|
3643
|
+
remainingSegments = result.remainingSegments;
|
|
3646
3644
|
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
|
|
3647
3645
|
}
|
|
3648
3646
|
const childConfig = getChildConfig(route);
|
|
3649
|
-
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments,
|
|
3647
|
+
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments,
|
|
3650
3648
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
3651
3649
|
// snapshots and don't handle redirects here. That should have been done in
|
|
3652
3650
|
// `applyRedirects`.
|
|
@@ -3786,6 +3784,12 @@ function recognize(rootComponentType, config, serializer, paramsInheritanceStrat
|
|
|
3786
3784
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3787
3785
|
* found in the LICENSE file at https://angular.io/license
|
|
3788
3786
|
*/
|
|
3787
|
+
/**
|
|
3788
|
+
* A private symbol used to store the value of `Route.title` inside the `Route.data` if it is a
|
|
3789
|
+
* static string or `Route.resolve` if anything else. This allows us to reuse the existing route
|
|
3790
|
+
* data/resolvers to support the title feature without new instrumentation in the `Router` pipeline.
|
|
3791
|
+
*/
|
|
3792
|
+
const RouteTitle = Symbol('RouteTitle');
|
|
3789
3793
|
function resolveData(paramsInheritanceStrategy, moduleInjector) {
|
|
3790
3794
|
return mergeMap(t => {
|
|
3791
3795
|
const { targetSnapshot, guards: { canActivateChecks } } = t;
|
|
@@ -3798,14 +3802,18 @@ function resolveData(paramsInheritanceStrategy, moduleInjector) {
|
|
|
3798
3802
|
});
|
|
3799
3803
|
}
|
|
3800
3804
|
function runResolve(futureARS, futureRSS, paramsInheritanceStrategy, moduleInjector) {
|
|
3805
|
+
const config = futureARS.routeConfig;
|
|
3801
3806
|
const resolve = futureARS._resolve;
|
|
3807
|
+
if (config?.title !== undefined && !hasStaticTitle(config)) {
|
|
3808
|
+
resolve[RouteTitle] = config.title;
|
|
3809
|
+
}
|
|
3802
3810
|
return resolveNode(resolve, futureARS, futureRSS, moduleInjector)
|
|
3803
3811
|
.pipe(map((resolvedData) => {
|
|
3804
3812
|
futureARS._resolvedData = resolvedData;
|
|
3805
|
-
futureARS.data =
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
}
|
|
3813
|
+
futureARS.data = inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve;
|
|
3814
|
+
if (config && hasStaticTitle(config)) {
|
|
3815
|
+
futureARS.data[RouteTitle] = config.title;
|
|
3816
|
+
}
|
|
3809
3817
|
return null;
|
|
3810
3818
|
}));
|
|
3811
3819
|
}
|
|
@@ -3816,7 +3824,7 @@ function resolveNode(resolve, futureARS, futureRSS, moduleInjector) {
|
|
|
3816
3824
|
}
|
|
3817
3825
|
const data = {};
|
|
3818
3826
|
return from(keys).pipe(mergeMap(key => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)
|
|
3819
|
-
.pipe(tap((value) => {
|
|
3827
|
+
.pipe(take(1), tap((value) => {
|
|
3820
3828
|
data[key] = value;
|
|
3821
3829
|
}))), takeLast(1), mergeMap(() => {
|
|
3822
3830
|
// Ensure all resolvers returned values, otherwise don't emit any "next" and just complete
|
|
@@ -3835,6 +3843,9 @@ function getResolver(injectionToken, futureARS, futureRSS, moduleInjector) {
|
|
|
3835
3843
|
return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) :
|
|
3836
3844
|
wrapIntoObservable(resolver(futureARS, futureRSS));
|
|
3837
3845
|
}
|
|
3846
|
+
function hasStaticTitle(config) {
|
|
3847
|
+
return typeof config.title === 'string' || config.title === null;
|
|
3848
|
+
}
|
|
3838
3849
|
|
|
3839
3850
|
/**
|
|
3840
3851
|
* @license
|
|
@@ -4149,7 +4160,7 @@ class Router {
|
|
|
4149
4160
|
*/
|
|
4150
4161
|
this.onSameUrlNavigation = 'ignore';
|
|
4151
4162
|
/**
|
|
4152
|
-
* How to merge parameters, data,
|
|
4163
|
+
* How to merge parameters, data, resolved data, and title from parent to child
|
|
4153
4164
|
* routes. One of:
|
|
4154
4165
|
*
|
|
4155
4166
|
* - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
|
|
@@ -4169,6 +4180,8 @@ class Router {
|
|
|
4169
4180
|
/**
|
|
4170
4181
|
* Enables a bug fix that corrects relative link resolution in components with empty paths.
|
|
4171
4182
|
* @see `RouterModule`
|
|
4183
|
+
*
|
|
4184
|
+
* @deprecated
|
|
4172
4185
|
*/
|
|
4173
4186
|
this.relativeLinkResolution = 'corrected';
|
|
4174
4187
|
/**
|
|
@@ -4252,7 +4265,7 @@ class Router {
|
|
|
4252
4265
|
tap(t => {
|
|
4253
4266
|
this.currentNavigation = {
|
|
4254
4267
|
id: t.id,
|
|
4255
|
-
initialUrl: t.
|
|
4268
|
+
initialUrl: t.rawUrl,
|
|
4256
4269
|
extractedUrl: t.extractedUrl,
|
|
4257
4270
|
trigger: t.source,
|
|
4258
4271
|
extras: t.extras,
|
|
@@ -4821,6 +4834,7 @@ class Router {
|
|
|
4821
4834
|
this.events
|
|
4822
4835
|
.next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
|
|
4823
4836
|
this.lastSuccessfulNavigation = this.currentNavigation;
|
|
4837
|
+
this.titleStrategy?.updateTitle(this.routerState.snapshot);
|
|
4824
4838
|
t.resolve(true);
|
|
4825
4839
|
}, e => {
|
|
4826
4840
|
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
@@ -4830,20 +4844,6 @@ class Router {
|
|
|
4830
4844
|
if (this.disposed) {
|
|
4831
4845
|
return Promise.resolve(false);
|
|
4832
4846
|
}
|
|
4833
|
-
// Duplicate navigations may be triggered by attempts to sync AngularJS and
|
|
4834
|
-
// Angular router states. We have the setTimeout in the location listener to
|
|
4835
|
-
// ensure the imperative nav is scheduled before the browser nav.
|
|
4836
|
-
const lastNavigation = this.transitions.value;
|
|
4837
|
-
const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
|
|
4838
|
-
!isBrowserTriggeredNavigation(lastNavigation.source);
|
|
4839
|
-
const navToSameUrl = lastNavigation.rawUrl.toString() === rawUrl.toString();
|
|
4840
|
-
const lastNavigationInProgress = lastNavigation.id === this.currentNavigation?.id;
|
|
4841
|
-
// We consider duplicates as ones that goes to the same URL while the first
|
|
4842
|
-
// is still processing.
|
|
4843
|
-
const isDuplicateNav = navToSameUrl && lastNavigationInProgress;
|
|
4844
|
-
if (browserNavPrecededByRouterNav && isDuplicateNav) {
|
|
4845
|
-
return Promise.resolve(true); // return value is not used
|
|
4846
|
-
}
|
|
4847
4847
|
let resolve;
|
|
4848
4848
|
let reject;
|
|
4849
4849
|
let promise;
|
|
@@ -4985,9 +4985,9 @@ class Router {
|
|
|
4985
4985
|
return { navigationId };
|
|
4986
4986
|
}
|
|
4987
4987
|
}
|
|
4988
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4989
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4990
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4988
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
4989
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router });
|
|
4990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router, decorators: [{
|
|
4991
4991
|
type: Injectable
|
|
4992
4992
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
4993
4993
|
function validateCommands(commands) {
|
|
@@ -5026,7 +5026,7 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
5026
5026
|
* For example, `['/team', teamId, 'user', userName, {details: true}]`
|
|
5027
5027
|
* generates a link to `/team/11/user/bob;details=true`.
|
|
5028
5028
|
*
|
|
5029
|
-
* Multiple static segments can be merged into one term and combined with dynamic
|
|
5029
|
+
* Multiple static segments can be merged into one term and combined with dynamic segments.
|
|
5030
5030
|
* For example, `['/team/11/user', userName, {details: true}]`
|
|
5031
5031
|
*
|
|
5032
5032
|
* The input that you provide to the link is treated as a delta to the current URL.
|
|
@@ -5164,8 +5164,8 @@ class RouterLink {
|
|
|
5164
5164
|
return true;
|
|
5165
5165
|
}
|
|
5166
5166
|
const extras = {
|
|
5167
|
-
skipLocationChange:
|
|
5168
|
-
replaceUrl:
|
|
5167
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5168
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5169
5169
|
state: this.state,
|
|
5170
5170
|
};
|
|
5171
5171
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5182,13 +5182,13 @@ class RouterLink {
|
|
|
5182
5182
|
queryParams: this.queryParams,
|
|
5183
5183
|
fragment: this.fragment,
|
|
5184
5184
|
queryParamsHandling: this.queryParamsHandling,
|
|
5185
|
-
preserveFragment:
|
|
5185
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5186
5186
|
});
|
|
5187
5187
|
}
|
|
5188
5188
|
}
|
|
5189
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5190
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5189
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5190
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.11", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
|
|
5191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLink, decorators: [{
|
|
5192
5192
|
type: Directive,
|
|
5193
5193
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5194
5194
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5278,8 +5278,8 @@ class RouterLinkWithHref {
|
|
|
5278
5278
|
return true;
|
|
5279
5279
|
}
|
|
5280
5280
|
const extras = {
|
|
5281
|
-
skipLocationChange:
|
|
5282
|
-
replaceUrl:
|
|
5281
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5282
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5283
5283
|
state: this.state
|
|
5284
5284
|
};
|
|
5285
5285
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5301,13 +5301,13 @@ class RouterLinkWithHref {
|
|
|
5301
5301
|
queryParams: this.queryParams,
|
|
5302
5302
|
fragment: this.fragment,
|
|
5303
5303
|
queryParamsHandling: this.queryParamsHandling,
|
|
5304
|
-
preserveFragment:
|
|
5304
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5305
5305
|
});
|
|
5306
5306
|
}
|
|
5307
5307
|
}
|
|
5308
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5309
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5310
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5308
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5309
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.11", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
|
|
5310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5311
5311
|
type: Directive,
|
|
5312
5312
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5313
5313
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5341,9 +5341,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
|
|
|
5341
5341
|
args: ['click',
|
|
5342
5342
|
['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']]
|
|
5343
5343
|
}] } });
|
|
5344
|
-
function attrBoolValue(s) {
|
|
5345
|
-
return s === '' || !!s;
|
|
5346
|
-
}
|
|
5347
5344
|
|
|
5348
5345
|
/**
|
|
5349
5346
|
* @license
|
|
@@ -5519,9 +5516,9 @@ class RouterLinkActive {
|
|
|
5519
5516
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5520
5517
|
}
|
|
5521
5518
|
}
|
|
5522
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5523
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5519
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5520
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.11", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
5521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5525
5522
|
type: Directive,
|
|
5526
5523
|
args: [{
|
|
5527
5524
|
selector: '[routerLinkActive]',
|
|
@@ -5551,6 +5548,84 @@ function isActiveMatchOptions(options) {
|
|
|
5551
5548
|
return !!options.paths;
|
|
5552
5549
|
}
|
|
5553
5550
|
|
|
5551
|
+
/**
|
|
5552
|
+
* @license
|
|
5553
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5554
|
+
*
|
|
5555
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5556
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5557
|
+
*/
|
|
5558
|
+
/**
|
|
5559
|
+
* Provides a strategy for setting the page title after a router navigation.
|
|
5560
|
+
*
|
|
5561
|
+
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
5562
|
+
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
5563
|
+
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
5564
|
+
* ```
|
|
5565
|
+
* [
|
|
5566
|
+
* {path: 'base', title: 'base', children: [
|
|
5567
|
+
* {path: 'child', title: 'child'},
|
|
5568
|
+
* ],
|
|
5569
|
+
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
5570
|
+
* ]
|
|
5571
|
+
* ```
|
|
5572
|
+
*
|
|
5573
|
+
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
5574
|
+
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
5575
|
+
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
5576
|
+
* incorporate titles in named outlets.
|
|
5577
|
+
*
|
|
5578
|
+
* @publicApi
|
|
5579
|
+
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
5580
|
+
*/
|
|
5581
|
+
class TitleStrategy {
|
|
5582
|
+
/**
|
|
5583
|
+
* @returns The `title` of the deepest primary route.
|
|
5584
|
+
*/
|
|
5585
|
+
buildTitle(snapshot) {
|
|
5586
|
+
let pageTitle;
|
|
5587
|
+
let route = snapshot.root;
|
|
5588
|
+
while (route !== undefined) {
|
|
5589
|
+
pageTitle = this.getResolvedTitleForRoute(route) ?? pageTitle;
|
|
5590
|
+
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
5591
|
+
}
|
|
5592
|
+
return pageTitle;
|
|
5593
|
+
}
|
|
5594
|
+
/**
|
|
5595
|
+
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
5596
|
+
* `Route.title` property, which can either be a static string or a resolved value.
|
|
5597
|
+
*/
|
|
5598
|
+
getResolvedTitleForRoute(snapshot) {
|
|
5599
|
+
return snapshot.data[RouteTitle];
|
|
5600
|
+
}
|
|
5601
|
+
}
|
|
5602
|
+
/**
|
|
5603
|
+
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
5604
|
+
*/
|
|
5605
|
+
class DefaultTitleStrategy extends TitleStrategy {
|
|
5606
|
+
constructor(title) {
|
|
5607
|
+
super();
|
|
5608
|
+
this.title = title;
|
|
5609
|
+
}
|
|
5610
|
+
/**
|
|
5611
|
+
* Sets the title of the browser to the given value.
|
|
5612
|
+
*
|
|
5613
|
+
* @param title The `pageTitle` from the deepest primary route.
|
|
5614
|
+
*/
|
|
5615
|
+
updateTitle(snapshot) {
|
|
5616
|
+
const title = this.buildTitle(snapshot);
|
|
5617
|
+
if (title !== undefined) {
|
|
5618
|
+
this.title.setTitle(title);
|
|
5619
|
+
}
|
|
5620
|
+
}
|
|
5621
|
+
}
|
|
5622
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5623
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5625
|
+
type: Injectable,
|
|
5626
|
+
args: [{ providedIn: 'root' }]
|
|
5627
|
+
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
5628
|
+
|
|
5554
5629
|
/**
|
|
5555
5630
|
* @license
|
|
5556
5631
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5664,9 +5739,9 @@ class RouterPreloader {
|
|
|
5664
5739
|
});
|
|
5665
5740
|
}
|
|
5666
5741
|
}
|
|
5667
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5668
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5742
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.Injector }, { token: PreloadingStrategy }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5743
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterPreloader });
|
|
5744
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5670
5745
|
type: Injectable
|
|
5671
5746
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.Injector }, { type: PreloadingStrategy }]; } });
|
|
5672
5747
|
|
|
@@ -5752,9 +5827,9 @@ class RouterScroller {
|
|
|
5752
5827
|
}
|
|
5753
5828
|
}
|
|
5754
5829
|
}
|
|
5755
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5756
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5757
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5830
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5831
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller });
|
|
5832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller, decorators: [{
|
|
5758
5833
|
type: Injectable
|
|
5759
5834
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
5760
5835
|
|
|
@@ -5787,8 +5862,8 @@ const ROUTER_PROVIDERS = [
|
|
|
5787
5862
|
useFactory: setupRouter,
|
|
5788
5863
|
deps: [
|
|
5789
5864
|
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES,
|
|
5790
|
-
ROUTER_CONFIGURATION, [
|
|
5791
|
-
[RouteReuseStrategy, new Optional()]
|
|
5865
|
+
ROUTER_CONFIGURATION, DefaultTitleStrategy, [TitleStrategy, new Optional()],
|
|
5866
|
+
[UrlHandlingStrategy, new Optional()], [RouteReuseStrategy, new Optional()]
|
|
5792
5867
|
]
|
|
5793
5868
|
},
|
|
5794
5869
|
ChildrenOutletContexts,
|
|
@@ -5895,10 +5970,10 @@ class RouterModule {
|
|
|
5895
5970
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
5896
5971
|
}
|
|
5897
5972
|
}
|
|
5898
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5899
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5900
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5901
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5973
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5974
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
5975
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule });
|
|
5976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule, decorators: [{
|
|
5902
5977
|
type: NgModule,
|
|
5903
5978
|
args: [{
|
|
5904
5979
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -5950,7 +6025,7 @@ function provideRoutes(routes) {
|
|
|
5950
6025
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
5951
6026
|
];
|
|
5952
6027
|
}
|
|
5953
|
-
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
|
|
6028
|
+
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, defaultTitleStrategy, titleStrategy, urlHandlingStrategy, routeReuseStrategy) {
|
|
5954
6029
|
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
5955
6030
|
if (urlHandlingStrategy) {
|
|
5956
6031
|
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
@@ -5958,6 +6033,7 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
|
|
|
5958
6033
|
if (routeReuseStrategy) {
|
|
5959
6034
|
router.routeReuseStrategy = routeReuseStrategy;
|
|
5960
6035
|
}
|
|
6036
|
+
router.titleStrategy = titleStrategy ?? defaultTitleStrategy;
|
|
5961
6037
|
assignExtraOptionsToRouter(opts, router);
|
|
5962
6038
|
if (opts.enableTracing) {
|
|
5963
6039
|
router.events.subscribe((e) => {
|
|
@@ -6076,9 +6152,9 @@ class RouterInitializer {
|
|
|
6076
6152
|
this.destroyed = true;
|
|
6077
6153
|
}
|
|
6078
6154
|
}
|
|
6079
|
-
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6080
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6155
|
+
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6156
|
+
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterInitializer });
|
|
6157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6082
6158
|
type: Injectable
|
|
6083
6159
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6084
6160
|
function getAppInitializer(r) {
|
|
@@ -6118,7 +6194,7 @@ function provideRouterInitializer() {
|
|
|
6118
6194
|
/**
|
|
6119
6195
|
* @publicApi
|
|
6120
6196
|
*/
|
|
6121
|
-
const VERSION = new Version('14.0.0-next.
|
|
6197
|
+
const VERSION = new Version('14.0.0-next.11');
|
|
6122
6198
|
|
|
6123
6199
|
/**
|
|
6124
6200
|
* @license
|
|
@@ -6157,5 +6233,5 @@ const VERSION = new Version('14.0.0-next.0');
|
|
|
6157
6233
|
* Generated bundle index. Do not edit.
|
|
6158
6234
|
*/
|
|
6159
6235
|
|
|
6160
|
-
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten };
|
|
6236
|
+
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten };
|
|
6161
6237
|
//# sourceMappingURL=router.mjs.map
|