@angular/router 15.0.0-rc.2 → 15.0.0-rc.4
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/fesm2020/router.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-rc.
|
|
2
|
+
* @license Angular v15.0.0-rc.4
|
|
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.4", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
465
|
+
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
467
467
|
type: Injectable,
|
|
468
468
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
469
469
|
}] });
|
|
@@ -943,13 +943,6 @@ function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
|
943
943
|
// warning for `relativeLinkResolution: 'legacy'`, this may cause failures in tests where it
|
|
944
944
|
// didn't before.
|
|
945
945
|
const result = createTreeUsingPathIndex(route.snapshot?._lastPathIndex);
|
|
946
|
-
// Check if application is relying on `relativeLinkResolution: 'legacy'`
|
|
947
|
-
if (typeof ngDevMode === 'undefined' || !!ngDevMode) {
|
|
948
|
-
const correctedResult = createTreeUsingPathIndex(route.snapshot?._correctedLastPathIndex);
|
|
949
|
-
if (correctedResult.toString() !== result.toString()) {
|
|
950
|
-
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.`);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
946
|
return result;
|
|
954
947
|
}
|
|
955
948
|
function isMatrixParams(command) {
|
|
@@ -2085,7 +2078,7 @@ class ActivatedRouteSnapshot {
|
|
|
2085
2078
|
/** The outlet name of the route */
|
|
2086
2079
|
outlet,
|
|
2087
2080
|
/** The component of the route */
|
|
2088
|
-
component, routeConfig, urlSegment, lastPathIndex, resolve
|
|
2081
|
+
component, routeConfig, urlSegment, lastPathIndex, resolve) {
|
|
2089
2082
|
this.url = url;
|
|
2090
2083
|
this.params = params;
|
|
2091
2084
|
this.queryParams = queryParams;
|
|
@@ -2096,7 +2089,6 @@ class ActivatedRouteSnapshot {
|
|
|
2096
2089
|
this.routeConfig = routeConfig;
|
|
2097
2090
|
this._urlSegment = urlSegment;
|
|
2098
2091
|
this._lastPathIndex = lastPathIndex;
|
|
2099
|
-
this._correctedLastPathIndex = correctedLastPathIndex ?? lastPathIndex;
|
|
2100
2092
|
this._resolve = resolve;
|
|
2101
2093
|
}
|
|
2102
2094
|
/** The resolved route title */
|
|
@@ -2388,9 +2380,9 @@ class ChildrenOutletContexts {
|
|
|
2388
2380
|
return this.contexts.get(childName) || null;
|
|
2389
2381
|
}
|
|
2390
2382
|
}
|
|
2391
|
-
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2392
|
-
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2383
|
+
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2384
|
+
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2394
2386
|
type: Injectable,
|
|
2395
2387
|
args: [{ providedIn: 'root' }]
|
|
2396
2388
|
}] });
|
|
@@ -2610,9 +2602,9 @@ class RouterOutlet {
|
|
|
2610
2602
|
this.activateEvents.emit(this.activated.instance);
|
|
2611
2603
|
}
|
|
2612
2604
|
}
|
|
2613
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2614
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2615
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2605
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2606
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.4", 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 });
|
|
2607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2616
2608
|
type: Directive,
|
|
2617
2609
|
args: [{
|
|
2618
2610
|
selector: 'router-outlet',
|
|
@@ -2672,9 +2664,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2672
2664
|
*/
|
|
2673
2665
|
class ɵEmptyOutletComponent {
|
|
2674
2666
|
}
|
|
2675
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2676
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
2677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
2667
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2668
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-rc.4", 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"] }] });
|
|
2669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2678
2670
|
type: Component,
|
|
2679
2671
|
args: [{
|
|
2680
2672
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -2748,8 +2740,8 @@ function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
|
2748
2740
|
if (Array.isArray(route)) {
|
|
2749
2741
|
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': Array cannot be specified`);
|
|
2750
2742
|
}
|
|
2751
|
-
if (!route.
|
|
2752
|
-
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2743
|
+
if (!route.redirectTo && !route.component && !route.loadComponent && !route.children &&
|
|
2744
|
+
!route.loadChildren && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2753
2745
|
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`);
|
|
2754
2746
|
}
|
|
2755
2747
|
if (route.redirectTo && route.children) {
|
|
@@ -3490,7 +3482,7 @@ function match(segmentGroup, route, segments) {
|
|
|
3490
3482
|
positionalParamSegments: res.posParams ?? {}
|
|
3491
3483
|
};
|
|
3492
3484
|
}
|
|
3493
|
-
function split(segmentGroup, consumedSegments, slicedSegments, config
|
|
3485
|
+
function split(segmentGroup, consumedSegments, slicedSegments, config) {
|
|
3494
3486
|
if (slicedSegments.length > 0 &&
|
|
3495
3487
|
containsEmptyPathMatchesWithNamedOutlets(segmentGroup, slicedSegments, config)) {
|
|
3496
3488
|
const s = new UrlSegmentGroup(consumedSegments, createChildrenForEmptyPaths(segmentGroup, consumedSegments, config, new UrlSegmentGroup(slicedSegments, segmentGroup.children)));
|
|
@@ -3500,7 +3492,7 @@ function split(segmentGroup, consumedSegments, slicedSegments, config, relativeL
|
|
|
3500
3492
|
}
|
|
3501
3493
|
if (slicedSegments.length === 0 &&
|
|
3502
3494
|
containsEmptyPathMatches(segmentGroup, slicedSegments, config)) {
|
|
3503
|
-
const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children
|
|
3495
|
+
const s = new UrlSegmentGroup(segmentGroup.segments, addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, config, segmentGroup.children));
|
|
3504
3496
|
s._sourceSegment = segmentGroup;
|
|
3505
3497
|
s._segmentIndexShift = consumedSegments.length;
|
|
3506
3498
|
return { segmentGroup: s, slicedSegments };
|
|
@@ -3510,21 +3502,13 @@ function split(segmentGroup, consumedSegments, slicedSegments, config, relativeL
|
|
|
3510
3502
|
s._segmentIndexShift = consumedSegments.length;
|
|
3511
3503
|
return { segmentGroup: s, slicedSegments };
|
|
3512
3504
|
}
|
|
3513
|
-
function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children
|
|
3505
|
+
function addEmptyPathsToChildrenIfNeeded(segmentGroup, consumedSegments, slicedSegments, routes, children) {
|
|
3514
3506
|
const res = {};
|
|
3515
3507
|
for (const r of routes) {
|
|
3516
3508
|
if (emptyPathMatch(segmentGroup, slicedSegments, r) && !children[getOutlet(r)]) {
|
|
3517
3509
|
const s = new UrlSegmentGroup([], {});
|
|
3518
3510
|
s._sourceSegment = segmentGroup;
|
|
3519
|
-
|
|
3520
|
-
s._segmentIndexShift = segmentGroup.segments.length;
|
|
3521
|
-
if (typeof ngDevMode === 'undefined' || !!ngDevMode) {
|
|
3522
|
-
s._segmentIndexShiftCorrected = consumedSegments.length;
|
|
3523
|
-
}
|
|
3524
|
-
}
|
|
3525
|
-
else {
|
|
3526
|
-
s._segmentIndexShift = consumedSegments.length;
|
|
3527
|
-
}
|
|
3511
|
+
s._segmentIndexShift = consumedSegments.length;
|
|
3528
3512
|
res[getOutlet(r)] = s;
|
|
3529
3513
|
}
|
|
3530
3514
|
}
|
|
@@ -3934,8 +3918,8 @@ function newObservableError(e) {
|
|
|
3934
3918
|
// TODO(atscott): This pattern is used throughout the router code and can be `throwError` instead.
|
|
3935
3919
|
return new Observable((obs) => obs.error(e));
|
|
3936
3920
|
}
|
|
3937
|
-
function recognize$1(injector, rootComponentType, config, urlTree, url, urlSerializer, paramsInheritanceStrategy = 'emptyOnly'
|
|
3938
|
-
return new Recognizer(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy,
|
|
3921
|
+
function recognize$1(injector, rootComponentType, config, urlTree, url, urlSerializer, paramsInheritanceStrategy = 'emptyOnly') {
|
|
3922
|
+
return new Recognizer(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, urlSerializer)
|
|
3939
3923
|
.recognize()
|
|
3940
3924
|
.pipe(switchMap(result => {
|
|
3941
3925
|
if (result === null) {
|
|
@@ -3947,18 +3931,17 @@ function recognize$1(injector, rootComponentType, config, urlTree, url, urlSeria
|
|
|
3947
3931
|
}));
|
|
3948
3932
|
}
|
|
3949
3933
|
class Recognizer {
|
|
3950
|
-
constructor(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy,
|
|
3934
|
+
constructor(injector, rootComponentType, config, urlTree, url, paramsInheritanceStrategy, urlSerializer) {
|
|
3951
3935
|
this.injector = injector;
|
|
3952
3936
|
this.rootComponentType = rootComponentType;
|
|
3953
3937
|
this.config = config;
|
|
3954
3938
|
this.urlTree = urlTree;
|
|
3955
3939
|
this.url = url;
|
|
3956
3940
|
this.paramsInheritanceStrategy = paramsInheritanceStrategy;
|
|
3957
|
-
this.relativeLinkResolution = relativeLinkResolution;
|
|
3958
3941
|
this.urlSerializer = urlSerializer;
|
|
3959
3942
|
}
|
|
3960
3943
|
recognize() {
|
|
3961
|
-
const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined)
|
|
3944
|
+
const rootSegmentGroup = split(this.urlTree.root, [], [], this.config.filter(c => c.redirectTo === undefined))
|
|
3962
3945
|
.segmentGroup;
|
|
3963
3946
|
return this.processSegmentGroup(this.injector, this.config, rootSegmentGroup, PRIMARY_OUTLET)
|
|
3964
3947
|
.pipe(map(children => {
|
|
@@ -4045,12 +4028,7 @@ class Recognizer {
|
|
|
4045
4028
|
if (route.path === '**') {
|
|
4046
4029
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
4047
4030
|
const pathIndexShift = getPathIndexShift(rawSegment) + segments.length;
|
|
4048
|
-
const snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route)
|
|
4049
|
-
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
4050
|
-
// production bundle size. This value is intended only to surface a warning to users
|
|
4051
|
-
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
4052
|
-
(NG_DEV_MODE$5 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
|
|
4053
|
-
pathIndexShift));
|
|
4031
|
+
const snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route));
|
|
4054
4032
|
matchResult = of({
|
|
4055
4033
|
snapshot,
|
|
4056
4034
|
consumedSegments: [],
|
|
@@ -4065,9 +4043,7 @@ class Recognizer {
|
|
|
4065
4043
|
return null;
|
|
4066
4044
|
}
|
|
4067
4045
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
4068
|
-
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route)
|
|
4069
|
-
getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
4070
|
-
pathIndexShift));
|
|
4046
|
+
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route));
|
|
4071
4047
|
return { snapshot, consumedSegments, remainingSegments };
|
|
4072
4048
|
}));
|
|
4073
4049
|
}
|
|
@@ -4084,7 +4060,7 @@ class Recognizer {
|
|
|
4084
4060
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
4085
4061
|
// snapshots and don't handle redirects here. That should have been done in
|
|
4086
4062
|
// `applyRedirects`.
|
|
4087
|
-
childConfig.filter(c => c.redirectTo === undefined)
|
|
4063
|
+
childConfig.filter(c => c.redirectTo === undefined));
|
|
4088
4064
|
if (slicedSegments.length === 0 && segmentGroup.hasChildren()) {
|
|
4089
4065
|
return this.processChildren(childInjector, childConfig, segmentGroup).pipe(map(children => {
|
|
4090
4066
|
if (children === null) {
|
|
@@ -4222,8 +4198,8 @@ function getResolve(route) {
|
|
|
4222
4198
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4223
4199
|
* found in the LICENSE file at https://angular.io/license
|
|
4224
4200
|
*/
|
|
4225
|
-
function recognize(injector, rootComponentType, config, serializer, paramsInheritanceStrategy
|
|
4226
|
-
return mergeMap(t => recognize$1(injector, rootComponentType, config, t.urlAfterRedirects, serializer.serialize(t.urlAfterRedirects), serializer, paramsInheritanceStrategy
|
|
4201
|
+
function recognize(injector, rootComponentType, config, serializer, paramsInheritanceStrategy) {
|
|
4202
|
+
return mergeMap(t => recognize$1(injector, rootComponentType, config, t.urlAfterRedirects, serializer.serialize(t.urlAfterRedirects), serializer, paramsInheritanceStrategy)
|
|
4227
4203
|
.pipe(map(targetSnapshot => ({ ...t, targetSnapshot }))));
|
|
4228
4204
|
}
|
|
4229
4205
|
|
|
@@ -4360,9 +4336,9 @@ class TitleStrategy {
|
|
|
4360
4336
|
return snapshot.data[RouteTitleKey];
|
|
4361
4337
|
}
|
|
4362
4338
|
}
|
|
4363
|
-
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4364
|
-
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4365
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4339
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4340
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4366
4342
|
type: Injectable,
|
|
4367
4343
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4368
4344
|
}] });
|
|
@@ -4386,25 +4362,13 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4386
4362
|
}
|
|
4387
4363
|
}
|
|
4388
4364
|
}
|
|
4389
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4390
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4391
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4365
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4366
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4392
4368
|
type: Injectable,
|
|
4393
4369
|
args: [{ providedIn: 'root' }]
|
|
4394
4370
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
4395
4371
|
|
|
4396
|
-
/**
|
|
4397
|
-
* @license
|
|
4398
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4399
|
-
*
|
|
4400
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
4401
|
-
* found in the LICENSE file at https://angular.io/license
|
|
4402
|
-
*/
|
|
4403
|
-
/**
|
|
4404
|
-
* Exists to aid internal migration off of the deprecated relativeLinkResolution option.
|
|
4405
|
-
*/
|
|
4406
|
-
function assignRelativeLinkResolution(router) { }
|
|
4407
|
-
|
|
4408
4372
|
/**
|
|
4409
4373
|
* @license
|
|
4410
4374
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4610,9 +4574,9 @@ class RouterConfigLoader {
|
|
|
4610
4574
|
}));
|
|
4611
4575
|
}
|
|
4612
4576
|
}
|
|
4613
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4614
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4615
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
4577
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4578
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4616
4580
|
type: Injectable,
|
|
4617
4581
|
args: [{ providedIn: 'root' }]
|
|
4618
4582
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
@@ -4734,7 +4698,6 @@ function setupRouter() {
|
|
|
4734
4698
|
}
|
|
4735
4699
|
router.titleStrategy = titleStrategy ?? defaultTitleStrategy;
|
|
4736
4700
|
assignExtraOptionsToRouter(opts, router);
|
|
4737
|
-
assignRelativeLinkResolution(router);
|
|
4738
4701
|
return router;
|
|
4739
4702
|
}
|
|
4740
4703
|
/**
|
|
@@ -4843,12 +4806,6 @@ class Router {
|
|
|
4843
4806
|
* you can show an error message with the URL that failed.
|
|
4844
4807
|
*/
|
|
4845
4808
|
this.urlUpdateStrategy = 'deferred';
|
|
4846
|
-
/**
|
|
4847
|
-
* TODO(atscott): Remove all references to relativeLinkResolution when internal cleanup is
|
|
4848
|
-
* finished.
|
|
4849
|
-
* @internal
|
|
4850
|
-
*/
|
|
4851
|
-
this.relativeLinkResolution = 'corrected';
|
|
4852
4809
|
/**
|
|
4853
4810
|
* Configures how the Router attempts to restore state when a navigation is cancelled.
|
|
4854
4811
|
*
|
|
@@ -4982,7 +4939,7 @@ class Router {
|
|
|
4982
4939
|
overallTransitionState.urlAfterRedirects = t.urlAfterRedirects;
|
|
4983
4940
|
}),
|
|
4984
4941
|
// Recognize
|
|
4985
|
-
recognize(this.ngModule.injector, this.rootComponentType, this.config, this.urlSerializer, this.paramsInheritanceStrategy
|
|
4942
|
+
recognize(this.ngModule.injector, this.rootComponentType, this.config, this.urlSerializer, this.paramsInheritanceStrategy),
|
|
4986
4943
|
// Update URL if in `eager` update mode
|
|
4987
4944
|
tap(t => {
|
|
4988
4945
|
overallTransitionState.targetSnapshot = t.targetSnapshot;
|
|
@@ -5647,9 +5604,9 @@ class Router {
|
|
|
5647
5604
|
return { navigationId };
|
|
5648
5605
|
}
|
|
5649
5606
|
}
|
|
5650
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5651
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5652
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5607
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5608
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
|
|
5609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: Router, decorators: [{
|
|
5653
5610
|
type: Injectable,
|
|
5654
5611
|
args: [{
|
|
5655
5612
|
providedIn: 'root',
|
|
@@ -5948,12 +5905,12 @@ class RouterLink {
|
|
|
5948
5905
|
});
|
|
5949
5906
|
}
|
|
5950
5907
|
}
|
|
5951
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5952
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
5953
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
5908
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", 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 });
|
|
5909
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.4", 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 });
|
|
5910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterLink, decorators: [{
|
|
5954
5911
|
type: Directive,
|
|
5955
5912
|
args: [{
|
|
5956
|
-
selector: '
|
|
5913
|
+
selector: '[routerLink]',
|
|
5957
5914
|
standalone: true,
|
|
5958
5915
|
}]
|
|
5959
5916
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -6175,9 +6132,9 @@ class RouterLinkActive {
|
|
|
6175
6132
|
return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
|
|
6176
6133
|
}
|
|
6177
6134
|
}
|
|
6178
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6179
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
6180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6135
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6136
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-rc.4", 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 });
|
|
6137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
6181
6138
|
type: Directive,
|
|
6182
6139
|
args: [{
|
|
6183
6140
|
selector: '[routerLinkActive]',
|
|
@@ -6237,9 +6194,9 @@ class PreloadAllModules {
|
|
|
6237
6194
|
return fn().pipe(catchError(() => of(null)));
|
|
6238
6195
|
}
|
|
6239
6196
|
}
|
|
6240
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6241
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6197
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6198
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6243
6200
|
type: Injectable,
|
|
6244
6201
|
args: [{ providedIn: 'root' }]
|
|
6245
6202
|
}] });
|
|
@@ -6257,9 +6214,9 @@ class NoPreloading {
|
|
|
6257
6214
|
return of(null);
|
|
6258
6215
|
}
|
|
6259
6216
|
}
|
|
6260
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6261
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6262
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6217
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6218
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6263
6220
|
type: Injectable,
|
|
6264
6221
|
args: [{ providedIn: 'root' }]
|
|
6265
6222
|
}] });
|
|
@@ -6353,9 +6310,9 @@ class RouterPreloader {
|
|
|
6353
6310
|
});
|
|
6354
6311
|
}
|
|
6355
6312
|
}
|
|
6356
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6357
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6313
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6314
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
|
|
6315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6359
6316
|
type: Injectable,
|
|
6360
6317
|
args: [{ providedIn: 'root' }]
|
|
6361
6318
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
@@ -6453,9 +6410,9 @@ class RouterScroller {
|
|
|
6453
6410
|
}
|
|
6454
6411
|
}
|
|
6455
6412
|
}
|
|
6456
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6457
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6413
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6414
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterScroller });
|
|
6415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6459
6416
|
type: Injectable
|
|
6460
6417
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }]; } });
|
|
6461
6418
|
|
|
@@ -6505,7 +6462,9 @@ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
6505
6462
|
*/
|
|
6506
6463
|
function provideRouter(routes, ...features) {
|
|
6507
6464
|
return makeEnvironmentProviders([
|
|
6508
|
-
|
|
6465
|
+
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6466
|
+
NG_DEV_MODE$1 ? { provide: ROUTER_IS_PROVIDED, useValue: true } : [],
|
|
6467
|
+
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6509
6468
|
{ provide: APP_BOOTSTRAP_LISTENER, multi: true, useFactory: getBootstrapListener },
|
|
6510
6469
|
features.map(feature => feature.ɵproviders),
|
|
6511
6470
|
// TODO: All options used by the `assignExtraOptionsToRouter` factory need to be reviewed for
|
|
@@ -6523,6 +6482,23 @@ function rootRoute(router) {
|
|
|
6523
6482
|
function routerFeature(kind, providers) {
|
|
6524
6483
|
return { ɵkind: kind, ɵproviders: providers };
|
|
6525
6484
|
}
|
|
6485
|
+
/**
|
|
6486
|
+
* An Injection token used to indicate whether `provideRouter` or `RouterModule.forRoot` was ever
|
|
6487
|
+
* called.
|
|
6488
|
+
*/
|
|
6489
|
+
const ROUTER_IS_PROVIDED = new InjectionToken('', { providedIn: 'root', factory: () => false });
|
|
6490
|
+
const routerIsProvidedDevModeCheck = {
|
|
6491
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
6492
|
+
multi: true,
|
|
6493
|
+
useFactory() {
|
|
6494
|
+
return () => {
|
|
6495
|
+
if (!inject(ROUTER_IS_PROVIDED)) {
|
|
6496
|
+
console.warn('`provideRoutes` was called without `provideRouter` or `RouterModule.forRoot`. ' +
|
|
6497
|
+
'This is likely a mistake.');
|
|
6498
|
+
}
|
|
6499
|
+
};
|
|
6500
|
+
}
|
|
6501
|
+
};
|
|
6526
6502
|
/**
|
|
6527
6503
|
* Registers a [DI provider](guide/glossary#provider) for a set of routes.
|
|
6528
6504
|
* @param routes The route configuration to provide.
|
|
@@ -6536,11 +6512,14 @@ function routerFeature(kind, providers) {
|
|
|
6536
6512
|
* class LazyLoadedChildModule {}
|
|
6537
6513
|
* ```
|
|
6538
6514
|
*
|
|
6515
|
+
* @deprecated If necessary, provide routes using the `ROUTES` `InjectionToken`.
|
|
6516
|
+
* @see `ROUTES`
|
|
6539
6517
|
* @publicApi
|
|
6540
6518
|
*/
|
|
6541
6519
|
function provideRoutes(routes) {
|
|
6542
6520
|
return [
|
|
6543
6521
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6522
|
+
NG_DEV_MODE$1 ? routerIsProvidedDevModeCheck : [],
|
|
6544
6523
|
];
|
|
6545
6524
|
}
|
|
6546
6525
|
/**
|
|
@@ -6889,6 +6868,9 @@ const ROUTER_PROVIDERS = [
|
|
|
6889
6868
|
ChildrenOutletContexts,
|
|
6890
6869
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6891
6870
|
RouterConfigLoader,
|
|
6871
|
+
// Only used to warn when `provideRoutes` is used without `RouterModule` or `provideRouter`. Can
|
|
6872
|
+
// be removed when `provideRoutes` is removed.
|
|
6873
|
+
NG_DEV_MODE ? { provide: ROUTER_IS_PROVIDED, useValue: true } : [],
|
|
6892
6874
|
];
|
|
6893
6875
|
function routerNgProbeToken() {
|
|
6894
6876
|
return new NgProbeToken('Router', Router);
|
|
@@ -6940,7 +6922,7 @@ class RouterModule {
|
|
|
6940
6922
|
providers: [
|
|
6941
6923
|
ROUTER_PROVIDERS,
|
|
6942
6924
|
NG_DEV_MODE ? (config?.enableTracing ? withDebugTracing().ɵproviders : []) : [],
|
|
6943
|
-
|
|
6925
|
+
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6944
6926
|
{
|
|
6945
6927
|
provide: ROUTER_FORROOT_GUARD,
|
|
6946
6928
|
useFactory: provideForRootGuard,
|
|
@@ -6973,13 +6955,16 @@ class RouterModule {
|
|
|
6973
6955
|
*
|
|
6974
6956
|
*/
|
|
6975
6957
|
static forChild(routes) {
|
|
6976
|
-
return {
|
|
6958
|
+
return {
|
|
6959
|
+
ngModule: RouterModule,
|
|
6960
|
+
providers: [{ provide: ROUTES, multi: true, useValue: routes }],
|
|
6961
|
+
};
|
|
6977
6962
|
}
|
|
6978
6963
|
}
|
|
6979
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6980
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.
|
|
6981
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.
|
|
6964
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6965
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6966
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
|
|
6967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-rc.4", ngImport: i0, type: RouterModule, decorators: [{
|
|
6983
6968
|
type: NgModule,
|
|
6984
6969
|
args: [{
|
|
6985
6970
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -7064,7 +7049,7 @@ function provideRouterInitializer() {
|
|
|
7064
7049
|
/**
|
|
7065
7050
|
* @publicApi
|
|
7066
7051
|
*/
|
|
7067
|
-
const VERSION = new Version('15.0.0-rc.
|
|
7052
|
+
const VERSION = new Version('15.0.0-rc.4');
|
|
7068
7053
|
|
|
7069
7054
|
/**
|
|
7070
7055
|
* @license
|