@angular/router 15.0.0-rc.2 → 15.0.0-rc.3
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/components/empty_outlet.mjs +3 -3
- package/esm2020/src/create_url_tree.mjs +1 -8
- package/esm2020/src/directives/router_link.mjs +5 -5
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +3 -3
- package/esm2020/src/operators/recognize.mjs +3 -3
- package/esm2020/src/page_title_strategy.mjs +6 -6
- package/esm2020/src/provide_router.mjs +24 -2
- package/esm2020/src/recognize.mjs +8 -16
- package/esm2020/src/router.mjs +5 -13
- package/esm2020/src/router_config.mjs +1 -1
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +15 -9
- package/esm2020/src/router_outlet_context.mjs +3 -3
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/router_state.mjs +2 -3
- package/esm2020/src/url_tree.mjs +3 -3
- package/esm2020/src/utils/config.mjs +3 -3
- package/esm2020/src/utils/config_matching.mjs +5 -13
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +9 -9
- package/fesm2015/router.mjs +99 -114
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +9 -9
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +98 -113
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +9 -9
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +6 -7
- package/package.json +4 -4
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
- package/esm2020/src/patchable_relative_link_resolution.mjs +0 -12
package/fesm2015/router.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-rc.
|
|
2
|
+
* @license Angular v15.0.0-rc.3
|
|
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, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ApplicationRef, APP_INITIALIZER,
|
|
8
|
+
import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ENVIRONMENT_INITIALIZER, ApplicationRef, APP_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
11
11
|
import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
|
|
@@ -461,9 +461,9 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
461
461
|
*/
|
|
462
462
|
class UrlSerializer {
|
|
463
463
|
}
|
|
464
|
-
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
465
|
-
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
464
|
+
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
465
|
+
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
467
467
|
type: Injectable,
|
|
468
468
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
469
469
|
}] });
|
|
@@ -924,7 +924,7 @@ function createUrlTreeFromSegmentGroup(relativeTo, commands, queryParams, fragme
|
|
|
924
924
|
return tree(root, position.segmentGroup, newSegmentGroup, queryParams, fragment);
|
|
925
925
|
}
|
|
926
926
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
927
|
-
var _a
|
|
927
|
+
var _a;
|
|
928
928
|
if (commands.length === 0) {
|
|
929
929
|
return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment);
|
|
930
930
|
}
|
|
@@ -945,13 +945,6 @@ function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
|
945
945
|
// warning for `relativeLinkResolution: 'legacy'`, this may cause failures in tests where it
|
|
946
946
|
// didn't before.
|
|
947
947
|
const result = createTreeUsingPathIndex((_a = route.snapshot) === null || _a === void 0 ? void 0 : _a._lastPathIndex);
|
|
948
|
-
// Check if application is relying on `relativeLinkResolution: 'legacy'`
|
|
949
|
-
if (typeof ngDevMode === 'undefined' || !!ngDevMode) {
|
|
950
|
-
const correctedResult = createTreeUsingPathIndex((_b = route.snapshot) === null || _b === void 0 ? void 0 : _b._correctedLastPathIndex);
|
|
951
|
-
if (correctedResult.toString() !== result.toString()) {
|
|
952
|
-
console.warn(`relativeLinkResolution: 'legacy' is deprecated and will be removed in a future version of Angular. The link to ${result.toString()} will change to ${correctedResult.toString()} if the code is not updated before then.`);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
948
|
return result;
|
|
956
949
|
}
|
|
957
950
|
function isMatrixParams(command) {
|
|
@@ -2090,7 +2083,7 @@ class ActivatedRouteSnapshot {
|
|
|
2090
2083
|
/** The outlet name of the route */
|
|
2091
2084
|
outlet,
|
|
2092
2085
|
/** The component of the route */
|
|
2093
|
-
component, routeConfig, urlSegment, lastPathIndex, resolve
|
|
2086
|
+
component, routeConfig, urlSegment, lastPathIndex, resolve) {
|
|
2094
2087
|
this.url = url;
|
|
2095
2088
|
this.params = params;
|
|
2096
2089
|
this.queryParams = queryParams;
|
|
@@ -2101,7 +2094,6 @@ class ActivatedRouteSnapshot {
|
|
|
2101
2094
|
this.routeConfig = routeConfig;
|
|
2102
2095
|
this._urlSegment = urlSegment;
|
|
2103
2096
|
this._lastPathIndex = lastPathIndex;
|
|
2104
|
-
this._correctedLastPathIndex = correctedLastPathIndex !== null && correctedLastPathIndex !== void 0 ? correctedLastPathIndex : lastPathIndex;
|
|
2105
2097
|
this._resolve = resolve;
|
|
2106
2098
|
}
|
|
2107
2099
|
/** The resolved route title */
|
|
@@ -2394,9 +2386,9 @@ class ChildrenOutletContexts {
|
|
|
2394
2386
|
return this.contexts.get(childName) || null;
|
|
2395
2387
|
}
|
|
2396
2388
|
}
|
|
2397
|
-
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2398
|
-
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2389
|
+
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2390
|
+
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2400
2392
|
type: Injectable,
|
|
2401
2393
|
args: [{ providedIn: 'root' }]
|
|
2402
2394
|
}] });
|
|
@@ -2617,9 +2609,9 @@ class RouterOutlet {
|
|
|
2617
2609
|
this.activateEvents.emit(this.activated.instance);
|
|
2618
2610
|
}
|
|
2619
2611
|
}
|
|
2620
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2621
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2622
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2612
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2613
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.3", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 });
|
|
2614
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2623
2615
|
type: Directive,
|
|
2624
2616
|
args: [{
|
|
2625
2617
|
selector: 'router-outlet',
|
|
@@ -2679,9 +2671,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2679
2671
|
*/
|
|
2680
2672
|
class ɵEmptyOutletComponent {
|
|
2681
2673
|
}
|
|
2682
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2683
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2674
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2675
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.3", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2685
2677
|
type: Component,
|
|
2686
2678
|
args: [{
|
|
2687
2679
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -2756,8 +2748,8 @@ function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
|
2756
2748
|
if (Array.isArray(route)) {
|
|
2757
2749
|
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': Array cannot be specified`);
|
|
2758
2750
|
}
|
|
2759
|
-
if (!route.
|
|
2760
|
-
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2751
|
+
if (!route.redirectTo && !route.component && !route.loadComponent && !route.children &&
|
|
2752
|
+
!route.loadChildren && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2761
2753
|
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);
|
|
2762
2754
|
}
|
|
2763
2755
|
if (route.redirectTo && route.children) {
|
|
@@ -3503,7 +3495,7 @@ function match(segmentGroup, route, segments) {
|
|
|
3503
3495
|
positionalParamSegments: (_a = res.posParams) !== null && _a !== void 0 ? _a : {}
|
|
3504
3496
|
};
|
|
3505
3497
|
}
|
|
3506
|
-
function split(segmentGroup, consumedSegments, slicedSegments, config
|
|
3498
|
+
function split(segmentGroup, consumedSegments, slicedSegments, config) {
|
|
3507
3499
|
if (slicedSegments.length > 0 &&
|
|
3508
3500
|
containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {
|
|
3509
3501
|
const s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));
|
|
@@ -3513,7 +3505,7 @@ function split(segmentGroup, consumedSegments, slicedSegments, config, relativeL
|
|
|
3513
3505
|
}
|
|
3514
3506
|
if (slicedSegments.length === 0 &&
|
|
3515
3507
|
containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {
|
|
3516
|
-
const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children
|
|
3508
|
+
const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children));
|
|
3517
3509
|
s._sourceSegment = segmentGroup;
|
|
3518
3510
|
s._segmentIndexShift = consumedSegments.length;
|
|
3519
3511
|
return { segmentGroup: s, slicedSegments };
|
|
@@ -3523,21 +3515,13 @@ function split(segmentGroup, consumedSegments, slicedSegments, config, relativeL
|
|
|
3523
3515
|
s._segmentIndexShift = consumedSegments.length;
|
|
3524
3516
|
return { segmentGroup: s, slicedSegments };
|
|
3525
3517
|
}
|
|
3526
|
-
function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children
|
|
3518
|
+
function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children) {
|
|
3527
3519
|
const res = {};
|
|
3528
3520
|
for (const r of routes) {
|
|
3529
3521
|
if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {
|
|
3530
3522
|
const s = new UrlSegmentGroup([], {});
|
|
3531
3523
|
s._sourceSegment = segmentGroup;
|
|
3532
|
-
|
|
3533
|
-
s._segmentIndexShift = segmentGroup.segments.length;
|
|
3534
|
-
if (typeof ngDevMode === 'undefined' || !!ngDevMode) {
|
|
3535
|
-
s._segmentIndexShiftCorrected = consumedSegments.length;
|
|
3536
|
-
}
|
|
3537
|
-
}
|
|
3538
|
-
else {
|
|
3539
|
-
s._segmentIndexShift = consumedSegments.length;
|
|
3540
|
-
}
|
|
3524
|
+
s._segmentIndexShift = consumedSegments.length;
|
|
3541
3525
|
res[getOutlet(r)] = s;
|
|
3542
3526
|
}
|
|
3543
3527
|
}
|
|
@@ -3949,8 +3933,8 @@ function newObservableError(e) {
|
|
|
3949
3933
|
// TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.
|
|
3950
3934
|
return new Observable((obs) => obs.error(e));
|
|
3951
3935
|
}
|
|
3952
|
-
function recognize$1(injector, rootComponentType, config, urlTree, url, urlSerializer, paramsInheritanceStrategy = 'emptyOnly'
|
|
3953
|
-
return new Recognizer(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy,
|
|
3936
|
+
function recognize$1(injector, rootComponentType, config, urlTree, url, urlSerializer, paramsInheritanceStrategy = 'emptyOnly') {
|
|
3937
|
+
return new Recognizer(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, urlSerializer)
|
|
3954
3938
|
.recognize()
|
|
3955
3939
|
.pipe(switchMap(result => {
|
|
3956
3940
|
if (result === null) {
|
|
@@ -3962,18 +3946,17 @@ function recognize$1(injector, rootComponentType, config, urlTree, url, urlSeria
|
|
|
3962
3946
|
}));
|
|
3963
3947
|
}
|
|
3964
3948
|
class Recognizer {
|
|
3965
|
-
constructor(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy,
|
|
3949
|
+
constructor(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, urlSerializer) {
|
|
3966
3950
|
this.injector = injector;
|
|
3967
3951
|
this.rootComponentType = rootComponentType;
|
|
3968
3952
|
this.config = config;
|
|
3969
3953
|
this.urlTree = urlTree;
|
|
3970
3954
|
this.url = url;
|
|
3971
3955
|
this.paramsInheritanceStrategy = paramsInheritanceStrategy;
|
|
3972
|
-
this.relativeLinkResolution = relativeLinkResolution;
|
|
3973
3956
|
this.urlSerializer = urlSerializer;
|
|
3974
3957
|
}
|
|
3975
3958
|
recognize() {
|
|
3976
|
-
const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined)
|
|
3959
|
+
const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined))
|
|
3977
3960
|
.segmentGroup;
|
|
3978
3961
|
return this.processSegmentGroup(this.injector, this.config, rootSegmentGroup, PRIMARY_OUTLET)
|
|
3979
3962
|
.pipe(map(children => {
|
|
@@ -4062,12 +4045,7 @@ class Recognizer {
|
|
|
4062
4045
|
if (route.path === '**') {
|
|
4063
4046
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
4064
4047
|
const pathIndexShift = getPathIndexShift(rawSegment) + segments.length;
|
|
4065
|
-
const snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route)
|
|
4066
|
-
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
4067
|
-
// production bundle size. This value is intended only to surface a warning to users
|
|
4068
|
-
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
4069
|
-
(NG_DEV_MODE$5 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
|
|
4070
|
-
pathIndexShift));
|
|
4048
|
+
const snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route));
|
|
4071
4049
|
matchResult = of({
|
|
4072
4050
|
snapshot,
|
|
4073
4051
|
consumedSegments: [],
|
|
@@ -4083,9 +4061,7 @@ class Recognizer {
|
|
|
4083
4061
|
return null;
|
|
4084
4062
|
}
|
|
4085
4063
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
4086
|
-
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route)
|
|
4087
|
-
getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
4088
|
-
pathIndexShift));
|
|
4064
|
+
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route));
|
|
4089
4065
|
return { snapshot, consumedSegments, remainingSegments };
|
|
4090
4066
|
}));
|
|
4091
4067
|
}
|
|
@@ -4103,7 +4079,7 @@ class Recognizer {
|
|
|
4103
4079
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
4104
4080
|
// snapshots and don't handle redirects here. That should have been done in
|
|
4105
4081
|
// `applyRedirects`.
|
|
4106
|
-
childConfig.filter(c => c.redirectTo === undefined)
|
|
4082
|
+
childConfig.filter(c => c.redirectTo === undefined));
|
|
4107
4083
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
4108
4084
|
return this.processChildren(childInjector, childConfig, segmentGroup).pipe(map(children => {
|
|
4109
4085
|
if (children === null) {
|
|
@@ -4243,8 +4219,8 @@ function getResolve(route) {
|
|
|
4243
4219
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4244
4220
|
* found in the LICENSE file at https://angular.io/license
|
|
4245
4221
|
*/
|
|
4246
|
-
function recognize(injector, rootComponentType, config, serializer, paramsInheritanceStrategy
|
|
4247
|
-
return mergeMap(t => recognize$1(injector, rootComponentType, config, t.urlAfterRedirects, serializer.serialize(t.urlAfterRedirects), serializer, paramsInheritanceStrategy
|
|
4222
|
+
function recognize(injector, rootComponentType, config, serializer, paramsInheritanceStrategy) {
|
|
4223
|
+
return mergeMap(t => recognize$1(injector, rootComponentType, config, t.urlAfterRedirects, serializer.serialize(t.urlAfterRedirects), serializer, paramsInheritanceStrategy)
|
|
4248
4224
|
.pipe(map(targetSnapshot => (Object.assign(Object.assign({}, t), { targetSnapshot })))));
|
|
4249
4225
|
}
|
|
4250
4226
|
|
|
@@ -4383,9 +4359,9 @@ class TitleStrategy {
|
|
|
4383
4359
|
return snapshot.data[RouteTitleKey];
|
|
4384
4360
|
}
|
|
4385
4361
|
}
|
|
4386
|
-
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4387
|
-
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4388
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4362
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4363
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4389
4365
|
type: Injectable,
|
|
4390
4366
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4391
4367
|
}] });
|
|
@@ -4409,25 +4385,13 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4409
4385
|
}
|
|
4410
4386
|
}
|
|
4411
4387
|
}
|
|
4412
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4413
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4388
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4389
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4415
4391
|
type: Injectable,
|
|
4416
4392
|
args: [{ providedIn: 'root' }]
|
|
4417
4393
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
4418
4394
|
|
|
4419
|
-
/**
|
|
4420
|
-
* @license
|
|
4421
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4422
|
-
*
|
|
4423
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
4424
|
-
* found in the LICENSE file at https://angular.io/license
|
|
4425
|
-
*/
|
|
4426
|
-
/**
|
|
4427
|
-
* Exists to aid internal migration off of the deprecated relativeLinkResolution option.
|
|
4428
|
-
*/
|
|
4429
|
-
function assignRelativeLinkResolution(router) { }
|
|
4430
|
-
|
|
4431
4395
|
/**
|
|
4432
4396
|
* @license
|
|
4433
4397
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4634,9 +4598,9 @@ class RouterConfigLoader {
|
|
|
4634
4598
|
}));
|
|
4635
4599
|
}
|
|
4636
4600
|
}
|
|
4637
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4638
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4639
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4601
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4602
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4640
4604
|
type: Injectable,
|
|
4641
4605
|
args: [{ providedIn: 'root' }]
|
|
4642
4606
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
@@ -4759,7 +4723,6 @@ function setupRouter() {
|
|
|
4759
4723
|
}
|
|
4760
4724
|
router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
|
|
4761
4725
|
assignExtraOptionsToRouter(opts, router);
|
|
4762
|
-
assignRelativeLinkResolution(router);
|
|
4763
4726
|
return router;
|
|
4764
4727
|
}
|
|
4765
4728
|
/**
|
|
@@ -4868,12 +4831,6 @@ class Router {
|
|
|
4868
4831
|
* you can show an error message with the URL that failed.
|
|
4869
4832
|
*/
|
|
4870
4833
|
this.urlUpdateStrategy = 'deferred';
|
|
4871
|
-
/**
|
|
4872
|
-
* TODO(atscott): Remove all references to relativeLinkResolution when internal cleanup is
|
|
4873
|
-
* finished.
|
|
4874
|
-
* @internal
|
|
4875
|
-
*/
|
|
4876
|
-
this.relativeLinkResolution = 'corrected';
|
|
4877
4834
|
/**
|
|
4878
4835
|
* Configures how the Router attempts to restore state when a navigation is cancelled.
|
|
4879
4836
|
*
|
|
@@ -5004,7 +4961,7 @@ class Router {
|
|
|
5004
4961
|
overallTransitionState.urlAfterRedirects = t.urlAfterRedirects;
|
|
5005
4962
|
}),
|
|
5006
4963
|
// Recognize
|
|
5007
|
-
recognize(this.ngModule.injector, this.rootComponentType, this.config, this.urlSerializer, this.paramsInheritanceStrategy
|
|
4964
|
+
recognize(this.ngModule.injector, this.rootComponentType, this.config, this.urlSerializer, this.paramsInheritanceStrategy),
|
|
5008
4965
|
// Update URL if in `eager` update mode
|
|
5009
4966
|
tap(t => {
|
|
5010
4967
|
overallTransitionState.targetSnapshot = t.targetSnapshot;
|
|
@@ -5668,9 +5625,9 @@ class Router {
|
|
|
5668
5625
|
return { navigationId };
|
|
5669
5626
|
}
|
|
5670
5627
|
}
|
|
5671
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5672
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5673
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5628
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5629
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
|
|
5630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: Router, decorators: [{
|
|
5674
5631
|
type: Injectable,
|
|
5675
5632
|
args: [{
|
|
5676
5633
|
providedIn: 'root',
|
|
@@ -5964,12 +5921,12 @@ class RouterLink {
|
|
|
5964
5921
|
});
|
|
5965
5922
|
}
|
|
5966
5923
|
}
|
|
5967
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5968
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
5969
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5924
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5925
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.3", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 });
|
|
5926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterLink, decorators: [{
|
|
5970
5927
|
type: Directive,
|
|
5971
5928
|
args: [{
|
|
5972
|
-
selector: '
|
|
5929
|
+
selector: '[routerLink]',
|
|
5973
5930
|
standalone: true,
|
|
5974
5931
|
}]
|
|
5975
5932
|
}], ctorParameters: function () {
|
|
@@ -6195,9 +6152,9 @@ class RouterLinkActive {
|
|
|
6195
6152
|
return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
|
|
6196
6153
|
}
|
|
6197
6154
|
}
|
|
6198
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6199
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
6200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6155
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6156
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.3", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
6157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
6201
6158
|
type: Directive,
|
|
6202
6159
|
args: [{
|
|
6203
6160
|
selector: '[routerLinkActive]',
|
|
@@ -6259,9 +6216,9 @@ class PreloadAllModules {
|
|
|
6259
6216
|
return fn().pipe(catchError(() => of(null)));
|
|
6260
6217
|
}
|
|
6261
6218
|
}
|
|
6262
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6263
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6219
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6220
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6265
6222
|
type: Injectable,
|
|
6266
6223
|
args: [{ providedIn: 'root' }]
|
|
6267
6224
|
}] });
|
|
@@ -6279,9 +6236,9 @@ class NoPreloading {
|
|
|
6279
6236
|
return of(null);
|
|
6280
6237
|
}
|
|
6281
6238
|
}
|
|
6282
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6283
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6284
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6239
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6240
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6285
6242
|
type: Injectable,
|
|
6286
6243
|
args: [{ providedIn: 'root' }]
|
|
6287
6244
|
}] });
|
|
@@ -6377,9 +6334,9 @@ class RouterPreloader {
|
|
|
6377
6334
|
});
|
|
6378
6335
|
}
|
|
6379
6336
|
}
|
|
6380
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6381
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6337
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6338
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
|
|
6339
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6383
6340
|
type: Injectable,
|
|
6384
6341
|
args: [{ providedIn: 'root' }]
|
|
6385
6342
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
@@ -6470,9 +6427,9 @@ class RouterScroller {
|
|
|
6470
6427
|
}
|
|
6471
6428
|
}
|
|
6472
6429
|
}
|
|
6473
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6474
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6430
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6431
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterScroller });
|
|
6432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6476
6433
|
type: Injectable
|
|
6477
6434
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }]; } });
|
|
6478
6435
|
|
|
@@ -6522,7 +6479,9 @@ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
6522
6479
|
*/
|
|
6523
6480
|
function provideRouter(routes, ...features) {
|
|
6524
6481
|
return makeEnvironmentProviders([
|
|
6525
|
-
|
|
6482
|
+
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6483
|
+
NG_DEV_MODE$1 ? { provide: ROUTER_IS_PROVIDED, useValue: true } : [],
|
|
6484
|
+
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6526
6485
|
{ provide: APP_BOOTSTRAP_LISTENER, multi: true, useFactory: getBootstrapListener },
|
|
6527
6486
|
features.map(feature => feature.ɵproviders),
|
|
6528
6487
|
// TODO: All options used by the `assignExtraOptionsToRouter` factory need to be reviewed for
|
|
@@ -6540,6 +6499,23 @@ function rootRoute(router) {
|
|
|
6540
6499
|
function routerFeature(kind, providers) {
|
|
6541
6500
|
return { ɵkind: kind, ɵproviders: providers };
|
|
6542
6501
|
}
|
|
6502
|
+
/**
|
|
6503
|
+
* An Injection token used to indicate whether `provideRouter` or `RouterModule.forRoot` was ever
|
|
6504
|
+
* called.
|
|
6505
|
+
*/
|
|
6506
|
+
const ROUTER_IS_PROVIDED = new InjectionToken('', { providedIn: 'root', factory: () => false });
|
|
6507
|
+
const routerIsProvidedDevModeCheck = {
|
|
6508
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
6509
|
+
multi: true,
|
|
6510
|
+
useFactory() {
|
|
6511
|
+
return () => {
|
|
6512
|
+
if (!inject(ROUTER_IS_PROVIDED)) {
|
|
6513
|
+
console.warn('`provideRoutes` was called without `provideRouter` or `RouterModule.forRoot`. ' +
|
|
6514
|
+
'This is likely a mistake.');
|
|
6515
|
+
}
|
|
6516
|
+
};
|
|
6517
|
+
}
|
|
6518
|
+
};
|
|
6543
6519
|
/**
|
|
6544
6520
|
* Registers a [DI provider](guide/glossary#provider) for a set of routes.
|
|
6545
6521
|
* @param routes The route configuration to provide.
|
|
@@ -6553,11 +6529,14 @@ function routerFeature(kind, providers) {
|
|
|
6553
6529
|
* class LazyLoadedChildModule {}
|
|
6554
6530
|
* ```
|
|
6555
6531
|
*
|
|
6532
|
+
* @deprecated If necessary, provide routes using the `ROUTES` `InjectionToken`.
|
|
6533
|
+
* @see `ROUTES`
|
|
6556
6534
|
* @publicApi
|
|
6557
6535
|
*/
|
|
6558
6536
|
function provideRoutes(routes) {
|
|
6559
6537
|
return [
|
|
6560
6538
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6539
|
+
NG_DEV_MODE$1 ? routerIsProvidedDevModeCheck : [],
|
|
6561
6540
|
];
|
|
6562
6541
|
}
|
|
6563
6542
|
/**
|
|
@@ -6908,6 +6887,9 @@ const ROUTER_PROVIDERS = [
|
|
|
6908
6887
|
ChildrenOutletContexts,
|
|
6909
6888
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6910
6889
|
RouterConfigLoader,
|
|
6890
|
+
// Only used to warn when `provideRoutes` is used without `RouterModule` or `provideRouter`. Can
|
|
6891
|
+
// be removed when `provideRoutes` is removed.
|
|
6892
|
+
NG_DEV_MODE ? { provide: ROUTER_IS_PROVIDED, useValue: true } : [],
|
|
6911
6893
|
];
|
|
6912
6894
|
function routerNgProbeToken() {
|
|
6913
6895
|
return new NgProbeToken('Router', Router);
|
|
@@ -6959,7 +6941,7 @@ class RouterModule {
|
|
|
6959
6941
|
providers: [
|
|
6960
6942
|
ROUTER_PROVIDERS,
|
|
6961
6943
|
NG_DEV_MODE ? ((config === null || config === void 0 ? void 0 : config.enableTracing) ? withDebugTracing().ɵproviders : []) : [],
|
|
6962
|
-
|
|
6944
|
+
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6963
6945
|
{
|
|
6964
6946
|
provide: ROUTER_FORROOT_GUARD,
|
|
6965
6947
|
useFactory: provideForRootGuard,
|
|
@@ -6992,13 +6974,16 @@ class RouterModule {
|
|
|
6992
6974
|
*
|
|
6993
6975
|
*/
|
|
6994
6976
|
static forChild(routes) {
|
|
6995
|
-
return {
|
|
6977
|
+
return {
|
|
6978
|
+
ngModule: RouterModule,
|
|
6979
|
+
providers: [{ provide: ROUTES, multi: true, useValue: routes }],
|
|
6980
|
+
};
|
|
6996
6981
|
}
|
|
6997
6982
|
}
|
|
6998
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6999
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
7000
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
7001
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6983
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6984
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6985
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
|
|
6986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.3", ngImport: i0, type: RouterModule, decorators: [{
|
|
7002
6987
|
type: NgModule,
|
|
7003
6988
|
args: [{
|
|
7004
6989
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -7085,7 +7070,7 @@ function provideRouterInitializer() {
|
|
|
7085
7070
|
/**
|
|
7086
7071
|
* @publicApi
|
|
7087
7072
|
*/
|
|
7088
|
-
const VERSION = new Version('15.0.0-rc.
|
|
7073
|
+
const VERSION = new Version('15.0.0-rc.3');
|
|
7089
7074
|
|
|
7090
7075
|
/**
|
|
7091
7076
|
* @license
|