@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/fesm2015/router.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
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
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
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';
|
|
9
|
-
import { from, of, BehaviorSubject, combineLatest,
|
|
8
|
+
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';
|
|
9
|
+
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, refCount, finalize, mergeAll } from 'rxjs/operators';
|
|
11
11
|
import * as i3 from '@angular/common';
|
|
12
12
|
import { Location, LocationStrategy, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
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
|
}
|
|
@@ -1453,9 +1454,10 @@ function inheritedParamsDataResolve(route, paramsInheritanceStrategy = 'emptyOnl
|
|
|
1453
1454
|
/** @internal */
|
|
1454
1455
|
function flattenInherited(pathFromRoot) {
|
|
1455
1456
|
return pathFromRoot.reduce((res, curr) => {
|
|
1457
|
+
var _a;
|
|
1456
1458
|
const params = Object.assign(Object.assign({}, res.params), curr.params);
|
|
1457
1459
|
const data = Object.assign(Object.assign({}, res.data), curr.data);
|
|
1458
|
-
const resolve = Object.assign(Object.assign({}, res.resolve), curr._resolvedData);
|
|
1460
|
+
const resolve = Object.assign(Object.assign(Object.assign(Object.assign({}, curr.data), res.resolve), (_a = curr.routeConfig) === null || _a === void 0 ? void 0 : _a.data), curr._resolvedData);
|
|
1459
1461
|
return { params, data, resolve };
|
|
1460
1462
|
}, { params: {}, data: {}, resolve: {} });
|
|
1461
1463
|
}
|
|
@@ -1712,17 +1714,17 @@ function createActivatedRoute(c) {
|
|
|
1712
1714
|
*/
|
|
1713
1715
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
1714
1716
|
if (commands.length === 0) {
|
|
1715
|
-
return tree(urlTree.root, urlTree.root, urlTree, queryParams, fragment);
|
|
1717
|
+
return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment);
|
|
1716
1718
|
}
|
|
1717
1719
|
const nav = computeNavigation(commands);
|
|
1718
1720
|
if (nav.toRoot()) {
|
|
1719
|
-
return tree(urlTree.root, new UrlSegmentGroup([], {}),
|
|
1721
|
+
return tree(urlTree.root, urlTree.root, new UrlSegmentGroup([], {}), queryParams, fragment);
|
|
1720
1722
|
}
|
|
1721
1723
|
const startingPosition = findStartingPosition(nav, urlTree, route);
|
|
1722
1724
|
const segmentGroup = startingPosition.processChildren ?
|
|
1723
1725
|
updateSegmentGroupChildren(startingPosition.segmentGroup, startingPosition.index, nav.commands) :
|
|
1724
1726
|
updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands);
|
|
1725
|
-
return tree(startingPosition.segmentGroup, segmentGroup,
|
|
1727
|
+
return tree(urlTree.root, startingPosition.segmentGroup, segmentGroup, queryParams, fragment);
|
|
1726
1728
|
}
|
|
1727
1729
|
function isMatrixParams(command) {
|
|
1728
1730
|
return typeof command === 'object' && command != null && !command.outlets && !command.segmentPath;
|
|
@@ -1734,17 +1736,18 @@ function isMatrixParams(command) {
|
|
|
1734
1736
|
function isCommandWithOutlets(command) {
|
|
1735
1737
|
return typeof command === 'object' && command != null && command.outlets;
|
|
1736
1738
|
}
|
|
1737
|
-
function tree(oldSegmentGroup, newSegmentGroup,
|
|
1739
|
+
function tree(oldRoot, oldSegmentGroup, newSegmentGroup, queryParams, fragment) {
|
|
1738
1740
|
let qp = {};
|
|
1739
1741
|
if (queryParams) {
|
|
1740
1742
|
forEach(queryParams, (value, name) => {
|
|
1741
1743
|
qp[name] = Array.isArray(value) ? value.map((v) => `${v}`) : `${value}`;
|
|
1742
1744
|
});
|
|
1743
1745
|
}
|
|
1744
|
-
if (
|
|
1746
|
+
if (oldRoot === oldSegmentGroup) {
|
|
1745
1747
|
return new UrlTree(newSegmentGroup, qp, fragment);
|
|
1746
1748
|
}
|
|
1747
|
-
|
|
1749
|
+
const newRoot = replaceSegment(oldRoot, oldSegmentGroup, newSegmentGroup);
|
|
1750
|
+
return new UrlTree(newRoot, qp, fragment);
|
|
1748
1751
|
}
|
|
1749
1752
|
function replaceSegment(current, oldSegment, newSegment) {
|
|
1750
1753
|
const children = {};
|
|
@@ -2524,9 +2527,9 @@ class RouterOutlet {
|
|
|
2524
2527
|
this.activateEvents.emit(this.activated.instance);
|
|
2525
2528
|
}
|
|
2526
2529
|
}
|
|
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.
|
|
2530
|
+
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 });
|
|
2531
|
+
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 });
|
|
2532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2530
2533
|
type: Directive,
|
|
2531
2534
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2532
2535
|
}], ctorParameters: function () {
|
|
@@ -2582,9 +2585,9 @@ class OutletInjector {
|
|
|
2582
2585
|
*/
|
|
2583
2586
|
class ɵEmptyOutletComponent {
|
|
2584
2587
|
}
|
|
2585
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2586
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2587
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2588
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2589
|
+
ɵ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"] }] });
|
|
2590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2588
2591
|
type: Component,
|
|
2589
2592
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2590
2593
|
}] });
|
|
@@ -2658,9 +2661,6 @@ function validateNode(route, fullPath) {
|
|
|
2658
2661
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2659
2662
|
throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2660
2663
|
}
|
|
2661
|
-
if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
|
|
2662
|
-
throw new Error(`Invalid configuration of route '${fullPath}': pathMatch can only be set to 'prefix' or 'full'`);
|
|
2663
|
-
}
|
|
2664
2664
|
}
|
|
2665
2665
|
if (route.children) {
|
|
2666
2666
|
validateConfig(route.children, fullPath);
|
|
@@ -2718,7 +2718,7 @@ function sortByMatchingOutlets(routes, outletName) {
|
|
|
2718
2718
|
const noMatch$1 = {
|
|
2719
2719
|
matched: false,
|
|
2720
2720
|
consumedSegments: [],
|
|
2721
|
-
|
|
2721
|
+
remainingSegments: [],
|
|
2722
2722
|
parameters: {},
|
|
2723
2723
|
positionalParamSegments: {}
|
|
2724
2724
|
};
|
|
@@ -2731,7 +2731,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2731
2731
|
return {
|
|
2732
2732
|
matched: true,
|
|
2733
2733
|
consumedSegments: [],
|
|
2734
|
-
|
|
2734
|
+
remainingSegments: segments,
|
|
2735
2735
|
parameters: {},
|
|
2736
2736
|
positionalParamSegments: {}
|
|
2737
2737
|
};
|
|
@@ -2749,7 +2749,7 @@ function match(segmentGroup, route, segments) {
|
|
|
2749
2749
|
return {
|
|
2750
2750
|
matched: true,
|
|
2751
2751
|
consumedSegments: res.consumed,
|
|
2752
|
-
|
|
2752
|
+
remainingSegments: segments.slice(res.consumed.length),
|
|
2753
2753
|
// TODO(atscott): investigate combining parameters and positionalParamSegments
|
|
2754
2754
|
parameters,
|
|
2755
2755
|
positionalParamSegments: (_a = res.posParams) !== null && _a !== void 0 ? _a : {}
|
|
@@ -2867,16 +2867,16 @@ class AbsoluteRedirect {
|
|
|
2867
2867
|
}
|
|
2868
2868
|
}
|
|
2869
2869
|
function noMatch(segmentGroup) {
|
|
2870
|
-
return
|
|
2870
|
+
return throwError(new NoMatch$1(segmentGroup));
|
|
2871
2871
|
}
|
|
2872
2872
|
function absoluteRedirect(newTree) {
|
|
2873
|
-
return
|
|
2873
|
+
return throwError(new AbsoluteRedirect(newTree));
|
|
2874
2874
|
}
|
|
2875
2875
|
function namedOutletsRedirect(redirectTo) {
|
|
2876
|
-
return
|
|
2876
|
+
return throwError(new Error(`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
2877
2877
|
}
|
|
2878
2878
|
function canLoadFails(route) {
|
|
2879
|
-
return
|
|
2879
|
+
return throwError(navigationCancelingError(`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
|
|
2880
2880
|
}
|
|
2881
2881
|
/**
|
|
2882
2882
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -2991,7 +2991,7 @@ class ApplyRedirects {
|
|
|
2991
2991
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
2992
2992
|
return of(new UrlSegmentGroup([], {}));
|
|
2993
2993
|
}
|
|
2994
|
-
|
|
2994
|
+
return noMatch(segmentGroup);
|
|
2995
2995
|
}
|
|
2996
2996
|
throw e;
|
|
2997
2997
|
}));
|
|
@@ -3025,7 +3025,7 @@ class ApplyRedirects {
|
|
|
3025
3025
|
}));
|
|
3026
3026
|
}
|
|
3027
3027
|
expandRegularSegmentAgainstRouteUsingRedirect(ngModule, segmentGroup, routes, route, segments, outlet) {
|
|
3028
|
-
const { matched, consumedSegments,
|
|
3028
|
+
const { matched, consumedSegments, remainingSegments, positionalParamSegments } = match(segmentGroup, route, segments);
|
|
3029
3029
|
if (!matched)
|
|
3030
3030
|
return noMatch(segmentGroup);
|
|
3031
3031
|
const newTree = this.applyRedirectCommands(consumedSegments, route.redirectTo, positionalParamSegments);
|
|
@@ -3033,7 +3033,7 @@ class ApplyRedirects {
|
|
|
3033
3033
|
return absoluteRedirect(newTree);
|
|
3034
3034
|
}
|
|
3035
3035
|
return this.lineralizeSegments(route, newTree).pipe(mergeMap((newSegments) => {
|
|
3036
|
-
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(
|
|
3036
|
+
return this.expandSegment(ngModule, segmentGroup, routes, newSegments.concat(remainingSegments), outlet, false);
|
|
3037
3037
|
}));
|
|
3038
3038
|
}
|
|
3039
3039
|
matchSegmentAgainstRoute(ngModule, rawSegmentGroup, route, segments, outlet) {
|
|
@@ -3048,15 +3048,14 @@ class ApplyRedirects {
|
|
|
3048
3048
|
}
|
|
3049
3049
|
return of(new UrlSegmentGroup(segments, {}));
|
|
3050
3050
|
}
|
|
3051
|
-
const { matched, consumedSegments,
|
|
3051
|
+
const { matched, consumedSegments, remainingSegments } = match(rawSegmentGroup, route, segments);
|
|
3052
3052
|
if (!matched)
|
|
3053
3053
|
return noMatch(rawSegmentGroup);
|
|
3054
|
-
const rawSlicedSegments = segments.slice(lastChild);
|
|
3055
3054
|
const childConfig$ = this.getChildConfig(ngModule, route, segments);
|
|
3056
3055
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
3057
3056
|
const childModule = routerConfig.module;
|
|
3058
3057
|
const childConfig = routerConfig.routes;
|
|
3059
|
-
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments,
|
|
3058
|
+
const { segmentGroup: splitSegmentGroup, slicedSegments } = split(rawSegmentGroup, consumedSegments, remainingSegments, childConfig);
|
|
3060
3059
|
// See comment on the other call to `split` about why this is necessary.
|
|
3061
3060
|
const segmentGroup = new UrlSegmentGroup(splitSegmentGroup.segments, splitSegmentGroup.children);
|
|
3062
3061
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
@@ -3633,7 +3632,7 @@ class Recognizer {
|
|
|
3633
3632
|
return null;
|
|
3634
3633
|
let snapshot;
|
|
3635
3634
|
let consumedSegments = [];
|
|
3636
|
-
let
|
|
3635
|
+
let remainingSegments = [];
|
|
3637
3636
|
if (route.path === '**') {
|
|
3638
3637
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
3639
3638
|
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + segments.length, getResolve(route));
|
|
@@ -3644,11 +3643,11 @@ class Recognizer {
|
|
|
3644
3643
|
return null;
|
|
3645
3644
|
}
|
|
3646
3645
|
consumedSegments = result.consumedSegments;
|
|
3647
|
-
|
|
3646
|
+
remainingSegments = result.remainingSegments;
|
|
3648
3647
|
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), getPathIndexShift(rawSegment) + consumedSegments.length, getResolve(route));
|
|
3649
3648
|
}
|
|
3650
3649
|
const childConfig = getChildConfig(route);
|
|
3651
|
-
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments,
|
|
3650
|
+
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments,
|
|
3652
3651
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
3653
3652
|
// snapshots and don't handle redirects here. That should have been done in
|
|
3654
3653
|
// `applyRedirects`.
|
|
@@ -3788,6 +3787,12 @@ function recognize(rootComponentType, config, serializer, paramsInheritanceStrat
|
|
|
3788
3787
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3789
3788
|
* found in the LICENSE file at https://angular.io/license
|
|
3790
3789
|
*/
|
|
3790
|
+
/**
|
|
3791
|
+
* A private symbol used to store the value of `Route.title` inside the `Route.data` if it is a
|
|
3792
|
+
* static string or `Route.resolve` if anything else. This allows us to reuse the existing route
|
|
3793
|
+
* data/resolvers to support the title feature without new instrumentation in the `Router` pipeline.
|
|
3794
|
+
*/
|
|
3795
|
+
const RouteTitle = Symbol('RouteTitle');
|
|
3791
3796
|
function resolveData(paramsInheritanceStrategy, moduleInjector) {
|
|
3792
3797
|
return mergeMap(t => {
|
|
3793
3798
|
const { targetSnapshot, guards: { canActivateChecks } } = t;
|
|
@@ -3800,11 +3805,18 @@ function resolveData(paramsInheritanceStrategy, moduleInjector) {
|
|
|
3800
3805
|
});
|
|
3801
3806
|
}
|
|
3802
3807
|
function runResolve(futureARS, futureRSS, paramsInheritanceStrategy, moduleInjector) {
|
|
3808
|
+
const config = futureARS.routeConfig;
|
|
3803
3809
|
const resolve = futureARS._resolve;
|
|
3810
|
+
if ((config === null || config === void 0 ? void 0 : config.title) !== undefined && !hasStaticTitle(config)) {
|
|
3811
|
+
resolve[RouteTitle] = config.title;
|
|
3812
|
+
}
|
|
3804
3813
|
return resolveNode(resolve, futureARS, futureRSS, moduleInjector)
|
|
3805
3814
|
.pipe(map((resolvedData) => {
|
|
3806
3815
|
futureARS._resolvedData = resolvedData;
|
|
3807
|
-
futureARS.data =
|
|
3816
|
+
futureARS.data = inheritedParamsDataResolve(futureARS, paramsInheritanceStrategy).resolve;
|
|
3817
|
+
if (config && hasStaticTitle(config)) {
|
|
3818
|
+
futureARS.data[RouteTitle] = config.title;
|
|
3819
|
+
}
|
|
3808
3820
|
return null;
|
|
3809
3821
|
}));
|
|
3810
3822
|
}
|
|
@@ -3815,7 +3827,7 @@ function resolveNode(resolve, futureARS, futureRSS, moduleInjector) {
|
|
|
3815
3827
|
}
|
|
3816
3828
|
const data = {};
|
|
3817
3829
|
return from(keys).pipe(mergeMap(key => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)
|
|
3818
|
-
.pipe(tap((value) => {
|
|
3830
|
+
.pipe(take(1), tap((value) => {
|
|
3819
3831
|
data[key] = value;
|
|
3820
3832
|
}))), takeLast(1), mergeMap(() => {
|
|
3821
3833
|
// Ensure all resolvers returned values, otherwise don't emit any "next" and just complete
|
|
@@ -3834,6 +3846,9 @@ function getResolver(injectionToken, futureARS, futureRSS, moduleInjector) {
|
|
|
3834
3846
|
return resolver.resolve ? wrapIntoObservable(resolver.resolve(futureARS, futureRSS)) :
|
|
3835
3847
|
wrapIntoObservable(resolver(futureARS, futureRSS));
|
|
3836
3848
|
}
|
|
3849
|
+
function hasStaticTitle(config) {
|
|
3850
|
+
return typeof config.title === 'string' || config.title === null;
|
|
3851
|
+
}
|
|
3837
3852
|
|
|
3838
3853
|
/**
|
|
3839
3854
|
* @license
|
|
@@ -4141,7 +4156,7 @@ class Router {
|
|
|
4141
4156
|
*/
|
|
4142
4157
|
this.onSameUrlNavigation = 'ignore';
|
|
4143
4158
|
/**
|
|
4144
|
-
* How to merge parameters, data,
|
|
4159
|
+
* How to merge parameters, data, resolved data, and title from parent to child
|
|
4145
4160
|
* routes. One of:
|
|
4146
4161
|
*
|
|
4147
4162
|
* - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
|
|
@@ -4161,6 +4176,8 @@ class Router {
|
|
|
4161
4176
|
/**
|
|
4162
4177
|
* Enables a bug fix that corrects relative link resolution in components with empty paths.
|
|
4163
4178
|
* @see `RouterModule`
|
|
4179
|
+
*
|
|
4180
|
+
* @deprecated
|
|
4164
4181
|
*/
|
|
4165
4182
|
this.relativeLinkResolution = 'corrected';
|
|
4166
4183
|
/**
|
|
@@ -4245,7 +4262,7 @@ class Router {
|
|
|
4245
4262
|
tap(t => {
|
|
4246
4263
|
this.currentNavigation = {
|
|
4247
4264
|
id: t.id,
|
|
4248
|
-
initialUrl: t.
|
|
4265
|
+
initialUrl: t.rawUrl,
|
|
4249
4266
|
extractedUrl: t.extractedUrl,
|
|
4250
4267
|
trigger: t.source,
|
|
4251
4268
|
extras: t.extras,
|
|
@@ -4798,36 +4815,24 @@ class Router {
|
|
|
4798
4815
|
}
|
|
4799
4816
|
processNavigations() {
|
|
4800
4817
|
this.navigations.subscribe(t => {
|
|
4818
|
+
var _a;
|
|
4801
4819
|
this.navigated = true;
|
|
4802
4820
|
this.lastSuccessfulId = t.id;
|
|
4803
4821
|
this.currentPageId = t.targetPageId;
|
|
4804
4822
|
this.events
|
|
4805
4823
|
.next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
|
|
4806
4824
|
this.lastSuccessfulNavigation = this.currentNavigation;
|
|
4825
|
+
(_a = this.titleStrategy) === null || _a === void 0 ? void 0 : _a.updateTitle(this.routerState.snapshot);
|
|
4807
4826
|
t.resolve(true);
|
|
4808
4827
|
}, e => {
|
|
4809
4828
|
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
4810
4829
|
});
|
|
4811
4830
|
}
|
|
4812
4831
|
scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {
|
|
4813
|
-
var _a, _b
|
|
4832
|
+
var _a, _b;
|
|
4814
4833
|
if (this.disposed) {
|
|
4815
4834
|
return Promise.resolve(false);
|
|
4816
4835
|
}
|
|
4817
|
-
// Duplicate navigations may be triggered by attempts to sync AngularJS and
|
|
4818
|
-
// Angular router states. We have the setTimeout in the location listener to
|
|
4819
|
-
// ensure the imperative nav is scheduled before the browser nav.
|
|
4820
|
-
const lastNavigation = this.transitions.value;
|
|
4821
|
-
const browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
|
|
4822
|
-
!isBrowserTriggeredNavigation(lastNavigation.source);
|
|
4823
|
-
const navToSameUrl = lastNavigation.rawUrl.toString() === rawUrl.toString();
|
|
4824
|
-
const lastNavigationInProgress = lastNavigation.id === ((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.id);
|
|
4825
|
-
// We consider duplicates as ones that goes to the same URL while the first
|
|
4826
|
-
// is still processing.
|
|
4827
|
-
const isDuplicateNav = navToSameUrl && lastNavigationInProgress;
|
|
4828
|
-
if (browserNavPrecededByRouterNav && isDuplicateNav) {
|
|
4829
|
-
return Promise.resolve(true); // return value is not used
|
|
4830
|
-
}
|
|
4831
4836
|
let resolve;
|
|
4832
4837
|
let reject;
|
|
4833
4838
|
let promise;
|
|
@@ -4859,10 +4864,10 @@ class Router {
|
|
|
4859
4864
|
// If we're replacing the URL or doing a silent navigation, we do not want to increment the
|
|
4860
4865
|
// page id because we aren't pushing a new entry to history.
|
|
4861
4866
|
if (extras.replaceUrl || extras.skipLocationChange) {
|
|
4862
|
-
targetPageId = (
|
|
4867
|
+
targetPageId = (_a = this.browserPageId) !== null && _a !== void 0 ? _a : 0;
|
|
4863
4868
|
}
|
|
4864
4869
|
else {
|
|
4865
|
-
targetPageId = ((
|
|
4870
|
+
targetPageId = ((_b = this.browserPageId) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
4866
4871
|
}
|
|
4867
4872
|
}
|
|
4868
4873
|
}
|
|
@@ -4970,9 +4975,9 @@ class Router {
|
|
|
4970
4975
|
return { navigationId };
|
|
4971
4976
|
}
|
|
4972
4977
|
}
|
|
4973
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4974
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4975
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4978
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
4979
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router });
|
|
4980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: Router, decorators: [{
|
|
4976
4981
|
type: Injectable
|
|
4977
4982
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
4978
4983
|
function validateCommands(commands) {
|
|
@@ -5004,7 +5009,7 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
5004
5009
|
* For example, `['/team', teamId, 'user', userName, {details: true}]`
|
|
5005
5010
|
* generates a link to `/team/11/user/bob;details=true`.
|
|
5006
5011
|
*
|
|
5007
|
-
* Multiple static segments can be merged into one term and combined with dynamic
|
|
5012
|
+
* Multiple static segments can be merged into one term and combined with dynamic segments.
|
|
5008
5013
|
* For example, `['/team/11/user', userName, {details: true}]`
|
|
5009
5014
|
*
|
|
5010
5015
|
* The input that you provide to the link is treated as a delta to the current URL.
|
|
@@ -5142,8 +5147,8 @@ class RouterLink {
|
|
|
5142
5147
|
return true;
|
|
5143
5148
|
}
|
|
5144
5149
|
const extras = {
|
|
5145
|
-
skipLocationChange:
|
|
5146
|
-
replaceUrl:
|
|
5150
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5151
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5147
5152
|
state: this.state,
|
|
5148
5153
|
};
|
|
5149
5154
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5160,13 +5165,13 @@ class RouterLink {
|
|
|
5160
5165
|
queryParams: this.queryParams,
|
|
5161
5166
|
fragment: this.fragment,
|
|
5162
5167
|
queryParamsHandling: this.queryParamsHandling,
|
|
5163
|
-
preserveFragment:
|
|
5168
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5164
5169
|
});
|
|
5165
5170
|
}
|
|
5166
5171
|
}
|
|
5167
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5168
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5169
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5172
|
+
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 });
|
|
5173
|
+
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 });
|
|
5174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLink, decorators: [{
|
|
5170
5175
|
type: Directive,
|
|
5171
5176
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5172
5177
|
}], ctorParameters: function () {
|
|
@@ -5258,8 +5263,8 @@ class RouterLinkWithHref {
|
|
|
5258
5263
|
return true;
|
|
5259
5264
|
}
|
|
5260
5265
|
const extras = {
|
|
5261
|
-
skipLocationChange:
|
|
5262
|
-
replaceUrl:
|
|
5266
|
+
skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
|
|
5267
|
+
replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
|
|
5263
5268
|
state: this.state
|
|
5264
5269
|
};
|
|
5265
5270
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
@@ -5281,13 +5286,13 @@ class RouterLinkWithHref {
|
|
|
5281
5286
|
queryParams: this.queryParams,
|
|
5282
5287
|
fragment: this.fragment,
|
|
5283
5288
|
queryParamsHandling: this.queryParamsHandling,
|
|
5284
|
-
preserveFragment:
|
|
5289
|
+
preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
|
|
5285
5290
|
});
|
|
5286
5291
|
}
|
|
5287
5292
|
}
|
|
5288
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5289
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5293
|
+
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 });
|
|
5294
|
+
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 });
|
|
5295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5291
5296
|
type: Directive,
|
|
5292
5297
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5293
5298
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5321,9 +5326,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.0",
|
|
|
5321
5326
|
args: ['click',
|
|
5322
5327
|
['$event.button', '$event.ctrlKey', '$event.shiftKey', '$event.altKey', '$event.metaKey']]
|
|
5323
5328
|
}] } });
|
|
5324
|
-
function attrBoolValue(s) {
|
|
5325
|
-
return s === '' || !!s;
|
|
5326
|
-
}
|
|
5327
5329
|
|
|
5328
5330
|
/**
|
|
5329
5331
|
* @license
|
|
@@ -5501,9 +5503,9 @@ class RouterLinkActive {
|
|
|
5501
5503
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5502
5504
|
}
|
|
5503
5505
|
}
|
|
5504
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5505
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5506
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5506
|
+
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 });
|
|
5507
|
+
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 });
|
|
5508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5507
5509
|
type: Directive,
|
|
5508
5510
|
args: [{
|
|
5509
5511
|
selector: '[routerLinkActive]',
|
|
@@ -5535,6 +5537,85 @@ function isActiveMatchOptions(options) {
|
|
|
5535
5537
|
return !!options.paths;
|
|
5536
5538
|
}
|
|
5537
5539
|
|
|
5540
|
+
/**
|
|
5541
|
+
* @license
|
|
5542
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5543
|
+
*
|
|
5544
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5545
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5546
|
+
*/
|
|
5547
|
+
/**
|
|
5548
|
+
* Provides a strategy for setting the page title after a router navigation.
|
|
5549
|
+
*
|
|
5550
|
+
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
5551
|
+
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
5552
|
+
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
5553
|
+
* ```
|
|
5554
|
+
* [
|
|
5555
|
+
* {path: 'base', title: 'base', children: [
|
|
5556
|
+
* {path: 'child', title: 'child'},
|
|
5557
|
+
* ],
|
|
5558
|
+
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
5559
|
+
* ]
|
|
5560
|
+
* ```
|
|
5561
|
+
*
|
|
5562
|
+
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
5563
|
+
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
5564
|
+
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
5565
|
+
* incorporate titles in named outlets.
|
|
5566
|
+
*
|
|
5567
|
+
* @publicApi
|
|
5568
|
+
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
5569
|
+
*/
|
|
5570
|
+
class TitleStrategy {
|
|
5571
|
+
/**
|
|
5572
|
+
* @returns The `title` of the deepest primary route.
|
|
5573
|
+
*/
|
|
5574
|
+
buildTitle(snapshot) {
|
|
5575
|
+
var _a;
|
|
5576
|
+
let pageTitle;
|
|
5577
|
+
let route = snapshot.root;
|
|
5578
|
+
while (route !== undefined) {
|
|
5579
|
+
pageTitle = (_a = this.getResolvedTitleForRoute(route)) !== null && _a !== void 0 ? _a : pageTitle;
|
|
5580
|
+
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
5581
|
+
}
|
|
5582
|
+
return pageTitle;
|
|
5583
|
+
}
|
|
5584
|
+
/**
|
|
5585
|
+
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
5586
|
+
* `Route.title` property, which can either be a static string or a resolved value.
|
|
5587
|
+
*/
|
|
5588
|
+
getResolvedTitleForRoute(snapshot) {
|
|
5589
|
+
return snapshot.data[RouteTitle];
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
/**
|
|
5593
|
+
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
5594
|
+
*/
|
|
5595
|
+
class DefaultTitleStrategy extends TitleStrategy {
|
|
5596
|
+
constructor(title) {
|
|
5597
|
+
super();
|
|
5598
|
+
this.title = title;
|
|
5599
|
+
}
|
|
5600
|
+
/**
|
|
5601
|
+
* Sets the title of the browser to the given value.
|
|
5602
|
+
*
|
|
5603
|
+
* @param title The `pageTitle` from the deepest primary route.
|
|
5604
|
+
*/
|
|
5605
|
+
updateTitle(snapshot) {
|
|
5606
|
+
const title = this.buildTitle(snapshot);
|
|
5607
|
+
if (title !== undefined) {
|
|
5608
|
+
this.title.setTitle(title);
|
|
5609
|
+
}
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
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 });
|
|
5613
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5614
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5615
|
+
type: Injectable,
|
|
5616
|
+
args: [{ providedIn: 'root' }]
|
|
5617
|
+
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
5618
|
+
|
|
5538
5619
|
/**
|
|
5539
5620
|
* @license
|
|
5540
5621
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5648,9 +5729,9 @@ class RouterPreloader {
|
|
|
5648
5729
|
});
|
|
5649
5730
|
}
|
|
5650
5731
|
}
|
|
5651
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5652
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5653
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5732
|
+
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 });
|
|
5733
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterPreloader });
|
|
5734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5654
5735
|
type: Injectable
|
|
5655
5736
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.Injector }, { type: PreloadingStrategy }]; } });
|
|
5656
5737
|
|
|
@@ -5729,9 +5810,9 @@ class RouterScroller {
|
|
|
5729
5810
|
}
|
|
5730
5811
|
}
|
|
5731
5812
|
}
|
|
5732
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5733
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5734
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5813
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5814
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller });
|
|
5815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterScroller, decorators: [{
|
|
5735
5816
|
type: Injectable
|
|
5736
5817
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
5737
5818
|
|
|
@@ -5764,8 +5845,8 @@ const ROUTER_PROVIDERS = [
|
|
|
5764
5845
|
useFactory: setupRouter,
|
|
5765
5846
|
deps: [
|
|
5766
5847
|
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES,
|
|
5767
|
-
ROUTER_CONFIGURATION, [
|
|
5768
|
-
[RouteReuseStrategy, new Optional()]
|
|
5848
|
+
ROUTER_CONFIGURATION, DefaultTitleStrategy, [TitleStrategy, new Optional()],
|
|
5849
|
+
[UrlHandlingStrategy, new Optional()], [RouteReuseStrategy, new Optional()]
|
|
5769
5850
|
]
|
|
5770
5851
|
},
|
|
5771
5852
|
ChildrenOutletContexts,
|
|
@@ -5872,10 +5953,10 @@ class RouterModule {
|
|
|
5872
5953
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
5873
5954
|
}
|
|
5874
5955
|
}
|
|
5875
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5876
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5877
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5878
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5956
|
+
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 });
|
|
5957
|
+
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] });
|
|
5958
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule });
|
|
5959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterModule, decorators: [{
|
|
5879
5960
|
type: NgModule,
|
|
5880
5961
|
args: [{
|
|
5881
5962
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -5929,7 +6010,7 @@ function provideRoutes(routes) {
|
|
|
5929
6010
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
5930
6011
|
];
|
|
5931
6012
|
}
|
|
5932
|
-
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
|
|
6013
|
+
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {}, defaultTitleStrategy, titleStrategy, urlHandlingStrategy, routeReuseStrategy) {
|
|
5933
6014
|
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
5934
6015
|
if (urlHandlingStrategy) {
|
|
5935
6016
|
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
@@ -5937,6 +6018,7 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
|
|
|
5937
6018
|
if (routeReuseStrategy) {
|
|
5938
6019
|
router.routeReuseStrategy = routeReuseStrategy;
|
|
5939
6020
|
}
|
|
6021
|
+
router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
|
|
5940
6022
|
assignExtraOptionsToRouter(opts, router);
|
|
5941
6023
|
if (opts.enableTracing) {
|
|
5942
6024
|
router.events.subscribe((e) => {
|
|
@@ -6056,9 +6138,9 @@ class RouterInitializer {
|
|
|
6056
6138
|
this.destroyed = true;
|
|
6057
6139
|
}
|
|
6058
6140
|
}
|
|
6059
|
-
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6060
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6141
|
+
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 });
|
|
6142
|
+
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterInitializer });
|
|
6143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.11", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6062
6144
|
type: Injectable
|
|
6063
6145
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6064
6146
|
function getAppInitializer(r) {
|
|
@@ -6098,7 +6180,7 @@ function provideRouterInitializer() {
|
|
|
6098
6180
|
/**
|
|
6099
6181
|
* @publicApi
|
|
6100
6182
|
*/
|
|
6101
|
-
const VERSION = new Version('14.0.0-next.
|
|
6183
|
+
const VERSION = new Version('14.0.0-next.11');
|
|
6102
6184
|
|
|
6103
6185
|
/**
|
|
6104
6186
|
* @license
|
|
@@ -6137,5 +6219,5 @@ const VERSION = new Version('14.0.0-next.0');
|
|
|
6137
6219
|
* Generated bundle index. Do not edit.
|
|
6138
6220
|
*/
|
|
6139
6221
|
|
|
6140
|
-
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 };
|
|
6222
|
+
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 };
|
|
6141
6223
|
//# sourceMappingURL=router.mjs.map
|