@angular/router 14.1.0 → 14.1.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/apply_redirects.mjs +4 -3
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/directives/router_link.mjs +6 -6
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +3 -3
- package/esm2020/src/index.mjs +3 -2
- package/esm2020/src/operators/resolve_data.mjs +4 -3
- package/esm2020/src/page_title_strategy.mjs +6 -6
- package/esm2020/src/patchable_relative_link_resolution.mjs +12 -0
- package/esm2020/src/private_export.mjs +3 -2
- package/esm2020/src/recognize.mjs +4 -3
- package/esm2020/src/router.mjs +64 -9
- package/esm2020/src/router_config.mjs +19 -0
- package/esm2020/src/router_config_loader.mjs +6 -5
- package/esm2020/src/router_module.mjs +23 -79
- package/esm2020/src/router_outlet_context.mjs +9 -1
- package/esm2020/src/router_preloader.mjs +19 -11
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/url_tree.mjs +9 -2
- package/esm2020/src/utils/type_guards.mjs +5 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +4 -4
- package/fesm2015/router.mjs +285 -224
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +275 -222
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +8 -7
- package/package.json +4 -4
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2015/router.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.
|
|
2
|
+
* @license Angular v14.1.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, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory,
|
|
9
|
-
import { from, of, BehaviorSubject, combineLatest, concat, defer, pipe, throwError,
|
|
10
|
-
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, last as last$1, takeWhile, defaultIfEmpty, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
8
|
+
import { ɵisObservable, ɵisPromise, Injectable, ɵRuntimeError, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, inject, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, NgProbeToken, SkipSelf, NgModule, Inject, ApplicationRef, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
|
|
9
|
+
import { from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
11
10
|
import * as i3 from '@angular/common';
|
|
12
|
-
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy,
|
|
11
|
+
import { Location, ViewportScroller, LocationStrategy, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
12
|
+
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, last as last$1, takeWhile, defaultIfEmpty, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -182,7 +182,7 @@ function wrapIntoObservable(value) {
|
|
|
182
182
|
* Use of this source code is governed by an MIT-style license that can be
|
|
183
183
|
* found in the LICENSE file at https://angular.io/license
|
|
184
184
|
*/
|
|
185
|
-
const NG_DEV_MODE$
|
|
185
|
+
const NG_DEV_MODE$8 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
186
186
|
function createEmptyUrlTree() {
|
|
187
187
|
return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
|
|
188
188
|
}
|
|
@@ -439,6 +439,12 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
439
439
|
*/
|
|
440
440
|
class UrlSerializer {
|
|
441
441
|
}
|
|
442
|
+
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
443
|
+
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
445
|
+
type: Injectable,
|
|
446
|
+
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
447
|
+
}] });
|
|
442
448
|
/**
|
|
443
449
|
* @description
|
|
444
450
|
*
|
|
@@ -647,7 +653,7 @@ class UrlParser {
|
|
|
647
653
|
parseSegment() {
|
|
648
654
|
const path = matchSegments(this.remaining);
|
|
649
655
|
if (path === '' && this.peekStartsWith(';')) {
|
|
650
|
-
throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$
|
|
656
|
+
throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$8 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
|
|
651
657
|
}
|
|
652
658
|
this.capture(path);
|
|
653
659
|
return new UrlSegment(decode(path), this.parseMatrixParams());
|
|
@@ -716,7 +722,7 @@ class UrlParser {
|
|
|
716
722
|
// if is is not one of these characters, then the segment was unescaped
|
|
717
723
|
// or the group was not closed
|
|
718
724
|
if (next !== '/' && next !== ')' && next !== ';') {
|
|
719
|
-
throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$
|
|
725
|
+
throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$8 && `Cannot parse url '${this.url}'`);
|
|
720
726
|
}
|
|
721
727
|
let outletName = undefined;
|
|
722
728
|
if (path.indexOf(':') > -1) {
|
|
@@ -747,7 +753,7 @@ class UrlParser {
|
|
|
747
753
|
}
|
|
748
754
|
capture(str) {
|
|
749
755
|
if (!this.consumeOptional(str)) {
|
|
750
|
-
throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$
|
|
756
|
+
throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$8 && `Expected "${str}".`);
|
|
751
757
|
}
|
|
752
758
|
}
|
|
753
759
|
}
|
|
@@ -800,7 +806,7 @@ function isUrlTree(v) {
|
|
|
800
806
|
* Use of this source code is governed by an MIT-style license that can be
|
|
801
807
|
* found in the LICENSE file at https://angular.io/license
|
|
802
808
|
*/
|
|
803
|
-
const NG_DEV_MODE$
|
|
809
|
+
const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
804
810
|
/**
|
|
805
811
|
* Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`.
|
|
806
812
|
*
|
|
@@ -978,11 +984,11 @@ class Navigation {
|
|
|
978
984
|
this.numberOfDoubleDots = numberOfDoubleDots;
|
|
979
985
|
this.commands = commands;
|
|
980
986
|
if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
|
|
981
|
-
throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$
|
|
987
|
+
throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$7 && 'Root segment cannot have matrix parameters');
|
|
982
988
|
}
|
|
983
989
|
const cmdWithOutlet = commands.find(isCommandWithOutlets);
|
|
984
990
|
if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
|
|
985
|
-
throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$
|
|
991
|
+
throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$7 && '{outlets:{}} has to be the last command');
|
|
986
992
|
}
|
|
987
993
|
}
|
|
988
994
|
toRoot() {
|
|
@@ -1081,7 +1087,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
|
|
|
1081
1087
|
dd -= ci;
|
|
1082
1088
|
g = g.parent;
|
|
1083
1089
|
if (!g) {
|
|
1084
|
-
throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$
|
|
1090
|
+
throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$7 && 'Invalid number of \'../\'');
|
|
1085
1091
|
}
|
|
1086
1092
|
ci = g.segments.length;
|
|
1087
1093
|
}
|
|
@@ -2356,6 +2362,12 @@ class ChildrenOutletContexts {
|
|
|
2356
2362
|
return this.contexts.get(childName) || null;
|
|
2357
2363
|
}
|
|
2358
2364
|
}
|
|
2365
|
+
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2366
|
+
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2368
|
+
type: Injectable,
|
|
2369
|
+
args: [{ providedIn: 'root' }]
|
|
2370
|
+
}] });
|
|
2359
2371
|
|
|
2360
2372
|
/**
|
|
2361
2373
|
* @license
|
|
@@ -2364,7 +2376,7 @@ class ChildrenOutletContexts {
|
|
|
2364
2376
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2365
2377
|
* found in the LICENSE file at https://angular.io/license
|
|
2366
2378
|
*/
|
|
2367
|
-
const NG_DEV_MODE$
|
|
2379
|
+
const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
2368
2380
|
/**
|
|
2369
2381
|
* @description
|
|
2370
2382
|
*
|
|
@@ -2474,12 +2486,12 @@ class RouterOutlet {
|
|
|
2474
2486
|
*/
|
|
2475
2487
|
get component() {
|
|
2476
2488
|
if (!this.activated)
|
|
2477
|
-
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$
|
|
2489
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
|
|
2478
2490
|
return this.activated.instance;
|
|
2479
2491
|
}
|
|
2480
2492
|
get activatedRoute() {
|
|
2481
2493
|
if (!this.activated)
|
|
2482
|
-
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$
|
|
2494
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
|
|
2483
2495
|
return this._activatedRoute;
|
|
2484
2496
|
}
|
|
2485
2497
|
get activatedRouteData() {
|
|
@@ -2493,7 +2505,7 @@ class RouterOutlet {
|
|
|
2493
2505
|
*/
|
|
2494
2506
|
detach() {
|
|
2495
2507
|
if (!this.activated)
|
|
2496
|
-
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$
|
|
2508
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
|
|
2497
2509
|
this.location.detach();
|
|
2498
2510
|
const cmp = this.activated;
|
|
2499
2511
|
this.activated = null;
|
|
@@ -2521,7 +2533,7 @@ class RouterOutlet {
|
|
|
2521
2533
|
}
|
|
2522
2534
|
activateWith(activatedRoute, resolverOrInjector) {
|
|
2523
2535
|
if (this.isActivated) {
|
|
2524
|
-
throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$
|
|
2536
|
+
throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$6 && 'Cannot activate an already activated outlet');
|
|
2525
2537
|
}
|
|
2526
2538
|
this._activatedRoute = activatedRoute;
|
|
2527
2539
|
const location = this.location;
|
|
@@ -2543,9 +2555,9 @@ class RouterOutlet {
|
|
|
2543
2555
|
this.activateEvents.emit(this.activated.instance);
|
|
2544
2556
|
}
|
|
2545
2557
|
}
|
|
2546
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
2547
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.
|
|
2548
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
2558
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2559
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2560
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2549
2561
|
type: Directive,
|
|
2550
2562
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2551
2563
|
}], ctorParameters: function () {
|
|
@@ -2604,9 +2616,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2604
2616
|
*/
|
|
2605
2617
|
class ɵEmptyOutletComponent {
|
|
2606
2618
|
}
|
|
2607
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
2608
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.
|
|
2609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
2619
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2620
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2610
2622
|
type: Component,
|
|
2611
2623
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2612
2624
|
}] });
|
|
@@ -3166,6 +3178,9 @@ function isRedirectingNavigationCancelingError(error) {
|
|
|
3166
3178
|
function isNavigationCancelingError(error) {
|
|
3167
3179
|
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
3168
3180
|
}
|
|
3181
|
+
function isEmptyError(e) {
|
|
3182
|
+
return e instanceof EmptyError || (e === null || e === void 0 ? void 0 : e.name) === 'EmptyError';
|
|
3183
|
+
}
|
|
3169
3184
|
|
|
3170
3185
|
/**
|
|
3171
3186
|
* @license
|
|
@@ -3503,7 +3518,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
|
|
|
3503
3518
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3504
3519
|
* found in the LICENSE file at https://angular.io/license
|
|
3505
3520
|
*/
|
|
3506
|
-
const NG_DEV_MODE$
|
|
3521
|
+
const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
3507
3522
|
class NoMatch$1 {
|
|
3508
3523
|
constructor(segmentGroup) {
|
|
3509
3524
|
this.segmentGroup = segmentGroup || null;
|
|
@@ -3521,11 +3536,11 @@ function absoluteRedirect(newTree) {
|
|
|
3521
3536
|
return throwError(new AbsoluteRedirect(newTree));
|
|
3522
3537
|
}
|
|
3523
3538
|
function namedOutletsRedirect(redirectTo) {
|
|
3524
|
-
return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$
|
|
3539
|
+
return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$5 &&
|
|
3525
3540
|
`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
3526
3541
|
}
|
|
3527
3542
|
function canLoadFails(route) {
|
|
3528
|
-
return throwError(navigationCancelingError(NG_DEV_MODE$
|
|
3543
|
+
return throwError(navigationCancelingError(NG_DEV_MODE$5 &&
|
|
3529
3544
|
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`, 3 /* NavigationCancellationCode.GuardRejected */));
|
|
3530
3545
|
}
|
|
3531
3546
|
/**
|
|
@@ -3585,7 +3600,7 @@ class ApplyRedirects {
|
|
|
3585
3600
|
}));
|
|
3586
3601
|
}
|
|
3587
3602
|
noMatchError(e) {
|
|
3588
|
-
return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$
|
|
3603
|
+
return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$5 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
|
|
3589
3604
|
}
|
|
3590
3605
|
createUrlTree(rootCandidate, queryParams, fragment) {
|
|
3591
3606
|
const root = createRoot(rootCandidate);
|
|
@@ -3635,7 +3650,7 @@ class ApplyRedirects {
|
|
|
3635
3650
|
throw e;
|
|
3636
3651
|
}));
|
|
3637
3652
|
}), first((s) => !!s), catchError((e, _) => {
|
|
3638
|
-
if (e
|
|
3653
|
+
if (isEmptyError(e)) {
|
|
3639
3654
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
3640
3655
|
return of(new UrlSegmentGroup([], {}));
|
|
3641
3656
|
}
|
|
@@ -3802,7 +3817,7 @@ class ApplyRedirects {
|
|
|
3802
3817
|
findPosParam(redirectTo, redirectToUrlSegment, posParams) {
|
|
3803
3818
|
const pos = posParams[redirectToUrlSegment.path.substring(1)];
|
|
3804
3819
|
if (!pos)
|
|
3805
|
-
throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$
|
|
3820
|
+
throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$5 &&
|
|
3806
3821
|
`Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
|
|
3807
3822
|
return pos;
|
|
3808
3823
|
}
|
|
@@ -3838,7 +3853,7 @@ function applyRedirects(environmentInjector, configLoader, urlSerializer, config
|
|
|
3838
3853
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3839
3854
|
* found in the LICENSE file at https://angular.io/license
|
|
3840
3855
|
*/
|
|
3841
|
-
const NG_DEV_MODE$
|
|
3856
|
+
const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
3842
3857
|
class NoMatch {
|
|
3843
3858
|
}
|
|
3844
3859
|
function newObservableError(e) {
|
|
@@ -3927,7 +3942,7 @@ class Recognizer {
|
|
|
3927
3942
|
// multiple activated results for the same outlet. We should merge the children of
|
|
3928
3943
|
// these results so the final return value is only one `TreeNode` per outlet.
|
|
3929
3944
|
const mergedChildren = mergeEmptyPathMatches(children);
|
|
3930
|
-
if (NG_DEV_MODE$
|
|
3945
|
+
if (NG_DEV_MODE$4) {
|
|
3931
3946
|
// This should really never happen - we are only taking the first match for each
|
|
3932
3947
|
// outlet and merge the empty path matches.
|
|
3933
3948
|
checkOutletNameUniqueness(mergedChildren);
|
|
@@ -3941,7 +3956,7 @@ class Recognizer {
|
|
|
3941
3956
|
var _a;
|
|
3942
3957
|
return this.processSegmentAgainstRoute((_a = r._injector) !== null && _a !== void 0 ? _a : injector, r, segmentGroup, segments, outlet);
|
|
3943
3958
|
}), first((x) => !!x), catchError(e => {
|
|
3944
|
-
if (e
|
|
3959
|
+
if (isEmptyError(e)) {
|
|
3945
3960
|
if (noLeftoversInUrl(segmentGroup, segments, outlet)) {
|
|
3946
3961
|
return of([]);
|
|
3947
3962
|
}
|
|
@@ -3962,7 +3977,7 @@ class Recognizer {
|
|
|
3962
3977
|
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
3963
3978
|
// production bundle size. This value is intended only to surface a warning to users
|
|
3964
3979
|
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
3965
|
-
(NG_DEV_MODE$
|
|
3980
|
+
(NG_DEV_MODE$4 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
|
|
3966
3981
|
pathIndexShift));
|
|
3967
3982
|
matchResult = of({
|
|
3968
3983
|
snapshot,
|
|
@@ -3979,7 +3994,7 @@ class Recognizer {
|
|
|
3979
3994
|
return null;
|
|
3980
3995
|
}
|
|
3981
3996
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
3982
|
-
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), (NG_DEV_MODE$
|
|
3997
|
+
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), (NG_DEV_MODE$4 ?
|
|
3983
3998
|
getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
3984
3999
|
pathIndexShift));
|
|
3985
4000
|
return { snapshot, consumedSegments, remainingSegments };
|
|
@@ -4093,7 +4108,7 @@ function checkOutletNameUniqueness(nodes) {
|
|
|
4093
4108
|
if (routeWithSameOutletName) {
|
|
4094
4109
|
const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
|
|
4095
4110
|
const c = n.value.url.map(s => s.toString()).join('/');
|
|
4096
|
-
throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$
|
|
4111
|
+
throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$4 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
|
|
4097
4112
|
}
|
|
4098
4113
|
names[n.value.outlet] = n.value;
|
|
4099
4114
|
});
|
|
@@ -4193,7 +4208,7 @@ function resolveNode(resolve, futureARS, futureRSS, moduleInjector) {
|
|
|
4193
4208
|
return from(keys).pipe(mergeMap(key => getResolver(resolve[key], futureARS, futureRSS, moduleInjector)
|
|
4194
4209
|
.pipe(first(), tap((value) => {
|
|
4195
4210
|
data[key] = value;
|
|
4196
|
-
}))), takeLast(1), mapTo(data), catchError((e) => e
|
|
4211
|
+
}))), takeLast(1), mapTo(data), catchError((e) => isEmptyError(e) ? EMPTY : throwError(e)));
|
|
4197
4212
|
}
|
|
4198
4213
|
function getDataKeys(obj) {
|
|
4199
4214
|
return [...Object.keys(obj), ...Object.getOwnPropertySymbols(obj)];
|
|
@@ -4230,6 +4245,103 @@ function switchTap(next) {
|
|
|
4230
4245
|
});
|
|
4231
4246
|
}
|
|
4232
4247
|
|
|
4248
|
+
/**
|
|
4249
|
+
* @license
|
|
4250
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4251
|
+
*
|
|
4252
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4253
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4254
|
+
*/
|
|
4255
|
+
/**
|
|
4256
|
+
* Provides a strategy for setting the page title after a router navigation.
|
|
4257
|
+
*
|
|
4258
|
+
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
4259
|
+
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
4260
|
+
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
4261
|
+
* ```
|
|
4262
|
+
* [
|
|
4263
|
+
* {path: 'base', title: 'base', children: [
|
|
4264
|
+
* {path: 'child', title: 'child'},
|
|
4265
|
+
* ],
|
|
4266
|
+
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
4267
|
+
* ]
|
|
4268
|
+
* ```
|
|
4269
|
+
*
|
|
4270
|
+
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
4271
|
+
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
4272
|
+
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
4273
|
+
* incorporate titles in named outlets.
|
|
4274
|
+
*
|
|
4275
|
+
* @publicApi
|
|
4276
|
+
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
4277
|
+
*/
|
|
4278
|
+
class TitleStrategy {
|
|
4279
|
+
/**
|
|
4280
|
+
* @returns The `title` of the deepest primary route.
|
|
4281
|
+
*/
|
|
4282
|
+
buildTitle(snapshot) {
|
|
4283
|
+
var _a;
|
|
4284
|
+
let pageTitle;
|
|
4285
|
+
let route = snapshot.root;
|
|
4286
|
+
while (route !== undefined) {
|
|
4287
|
+
pageTitle = (_a = this.getResolvedTitleForRoute(route)) !== null && _a !== void 0 ? _a : pageTitle;
|
|
4288
|
+
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
4289
|
+
}
|
|
4290
|
+
return pageTitle;
|
|
4291
|
+
}
|
|
4292
|
+
/**
|
|
4293
|
+
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
4294
|
+
* `Route.title` property, which can either be a static string or a resolved value.
|
|
4295
|
+
*/
|
|
4296
|
+
getResolvedTitleForRoute(snapshot) {
|
|
4297
|
+
return snapshot.data[RouteTitle];
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4301
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4303
|
+
type: Injectable,
|
|
4304
|
+
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4305
|
+
}] });
|
|
4306
|
+
/**
|
|
4307
|
+
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
4308
|
+
*/
|
|
4309
|
+
class DefaultTitleStrategy extends TitleStrategy {
|
|
4310
|
+
constructor(title) {
|
|
4311
|
+
super();
|
|
4312
|
+
this.title = title;
|
|
4313
|
+
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Sets the title of the browser to the given value.
|
|
4316
|
+
*
|
|
4317
|
+
* @param title The `pageTitle` from the deepest primary route.
|
|
4318
|
+
*/
|
|
4319
|
+
updateTitle(snapshot) {
|
|
4320
|
+
const title = this.buildTitle(snapshot);
|
|
4321
|
+
if (title !== undefined) {
|
|
4322
|
+
this.title.setTitle(title);
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
}
|
|
4326
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4327
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4329
|
+
type: Injectable,
|
|
4330
|
+
args: [{ providedIn: 'root' }]
|
|
4331
|
+
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
4332
|
+
|
|
4333
|
+
/**
|
|
4334
|
+
* @license
|
|
4335
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4336
|
+
*
|
|
4337
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4338
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4339
|
+
*/
|
|
4340
|
+
/**
|
|
4341
|
+
* Exists to aid internal migration off of the deprecated relativeLinkResolution option.
|
|
4342
|
+
*/
|
|
4343
|
+
function assignRelativeLinkResolution(router) { }
|
|
4344
|
+
|
|
4233
4345
|
/**
|
|
4234
4346
|
* @license
|
|
4235
4347
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4295,6 +4407,24 @@ class BaseRouteReuseStrategy {
|
|
|
4295
4407
|
class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
4296
4408
|
}
|
|
4297
4409
|
|
|
4410
|
+
/**
|
|
4411
|
+
* @license
|
|
4412
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4413
|
+
*
|
|
4414
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4415
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4416
|
+
*/
|
|
4417
|
+
const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4418
|
+
/**
|
|
4419
|
+
* A [DI token](guide/glossary/#di-token) for the router service.
|
|
4420
|
+
*
|
|
4421
|
+
* @publicApi
|
|
4422
|
+
*/
|
|
4423
|
+
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$3 ? 'router config' : '', {
|
|
4424
|
+
providedIn: 'root',
|
|
4425
|
+
factory: () => ({}),
|
|
4426
|
+
});
|
|
4427
|
+
|
|
4298
4428
|
/**
|
|
4299
4429
|
* @license
|
|
4300
4430
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4402,10 +4532,11 @@ class RouterConfigLoader {
|
|
|
4402
4532
|
}));
|
|
4403
4533
|
}
|
|
4404
4534
|
}
|
|
4405
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
4406
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
4407
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
4408
|
-
type: Injectable
|
|
4535
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4536
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4537
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4538
|
+
type: Injectable,
|
|
4539
|
+
args: [{ providedIn: 'root' }]
|
|
4409
4540
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4410
4541
|
|
|
4411
4542
|
/**
|
|
@@ -4439,6 +4570,13 @@ class DefaultUrlHandlingStrategy {
|
|
|
4439
4570
|
}
|
|
4440
4571
|
}
|
|
4441
4572
|
|
|
4573
|
+
/**
|
|
4574
|
+
* @license
|
|
4575
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4576
|
+
*
|
|
4577
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4578
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4579
|
+
*/
|
|
4442
4580
|
const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4443
4581
|
function defaultErrorHandler(error) {
|
|
4444
4582
|
throw error;
|
|
@@ -4466,6 +4604,54 @@ const subsetMatchOptions = {
|
|
|
4466
4604
|
matrixParams: 'ignored',
|
|
4467
4605
|
queryParams: 'subset'
|
|
4468
4606
|
};
|
|
4607
|
+
function assignExtraOptionsToRouter(opts, router) {
|
|
4608
|
+
if (opts.errorHandler) {
|
|
4609
|
+
router.errorHandler = opts.errorHandler;
|
|
4610
|
+
}
|
|
4611
|
+
if (opts.malformedUriErrorHandler) {
|
|
4612
|
+
router.malformedUriErrorHandler = opts.malformedUriErrorHandler;
|
|
4613
|
+
}
|
|
4614
|
+
if (opts.onSameUrlNavigation) {
|
|
4615
|
+
router.onSameUrlNavigation = opts.onSameUrlNavigation;
|
|
4616
|
+
}
|
|
4617
|
+
if (opts.paramsInheritanceStrategy) {
|
|
4618
|
+
router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
|
|
4619
|
+
}
|
|
4620
|
+
if (opts.relativeLinkResolution) {
|
|
4621
|
+
router.relativeLinkResolution = opts.relativeLinkResolution;
|
|
4622
|
+
}
|
|
4623
|
+
if (opts.urlUpdateStrategy) {
|
|
4624
|
+
router.urlUpdateStrategy = opts.urlUpdateStrategy;
|
|
4625
|
+
}
|
|
4626
|
+
if (opts.canceledNavigationResolution) {
|
|
4627
|
+
router.canceledNavigationResolution = opts.canceledNavigationResolution;
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
function setupRouter() {
|
|
4631
|
+
var _a, _b;
|
|
4632
|
+
const urlSerializer = inject(UrlSerializer);
|
|
4633
|
+
const contexts = inject(ChildrenOutletContexts);
|
|
4634
|
+
const location = inject(Location);
|
|
4635
|
+
const injector = inject(Injector);
|
|
4636
|
+
const compiler = inject(Compiler);
|
|
4637
|
+
const config = (_a = inject(ROUTES, { optional: true })) !== null && _a !== void 0 ? _a : [];
|
|
4638
|
+
const opts = (_b = inject(ROUTER_CONFIGURATION, { optional: true })) !== null && _b !== void 0 ? _b : {};
|
|
4639
|
+
const defaultTitleStrategy = inject(DefaultTitleStrategy);
|
|
4640
|
+
const titleStrategy = inject(TitleStrategy, { optional: true });
|
|
4641
|
+
const urlHandlingStrategy = inject(UrlHandlingStrategy, { optional: true });
|
|
4642
|
+
const routeReuseStrategy = inject(RouteReuseStrategy, { optional: true });
|
|
4643
|
+
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
4644
|
+
if (urlHandlingStrategy) {
|
|
4645
|
+
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
4646
|
+
}
|
|
4647
|
+
if (routeReuseStrategy) {
|
|
4648
|
+
router.routeReuseStrategy = routeReuseStrategy;
|
|
4649
|
+
}
|
|
4650
|
+
router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
|
|
4651
|
+
assignExtraOptionsToRouter(opts, router);
|
|
4652
|
+
assignRelativeLinkResolution(router);
|
|
4653
|
+
return router;
|
|
4654
|
+
}
|
|
4469
4655
|
/**
|
|
4470
4656
|
* @description
|
|
4471
4657
|
*
|
|
@@ -5373,10 +5559,14 @@ class Router {
|
|
|
5373
5559
|
return { navigationId };
|
|
5374
5560
|
}
|
|
5375
5561
|
}
|
|
5376
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
5377
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
5378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
5379
|
-
type: Injectable
|
|
5562
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5563
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
|
|
5564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: Router, decorators: [{
|
|
5565
|
+
type: Injectable,
|
|
5566
|
+
args: [{
|
|
5567
|
+
providedIn: 'root',
|
|
5568
|
+
useFactory: setupRouter,
|
|
5569
|
+
}]
|
|
5380
5570
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5381
5571
|
function validateCommands(commands) {
|
|
5382
5572
|
for (let i = 0; i < commands.length; i++) {
|
|
@@ -5567,9 +5757,9 @@ class RouterLink {
|
|
|
5567
5757
|
});
|
|
5568
5758
|
}
|
|
5569
5759
|
}
|
|
5570
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
5571
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.
|
|
5572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
5760
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5761
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", 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 });
|
|
5762
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterLink, decorators: [{
|
|
5573
5763
|
type: Directive,
|
|
5574
5764
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5575
5765
|
}], ctorParameters: function () {
|
|
@@ -5688,9 +5878,9 @@ class RouterLinkWithHref {
|
|
|
5688
5878
|
});
|
|
5689
5879
|
}
|
|
5690
5880
|
}
|
|
5691
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
5692
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.
|
|
5693
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
5881
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5882
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", 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 });
|
|
5883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5694
5884
|
type: Directive,
|
|
5695
5885
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5696
5886
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5917,9 +6107,9 @@ class RouterLinkActive {
|
|
|
5917
6107
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5918
6108
|
}
|
|
5919
6109
|
}
|
|
5920
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
5921
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.
|
|
5922
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6110
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", 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 });
|
|
6111
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
6112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5923
6113
|
type: Directive,
|
|
5924
6114
|
args: [{
|
|
5925
6115
|
selector: '[routerLinkActive]',
|
|
@@ -5953,91 +6143,6 @@ function isActiveMatchOptions(options) {
|
|
|
5953
6143
|
return !!options.paths;
|
|
5954
6144
|
}
|
|
5955
6145
|
|
|
5956
|
-
/**
|
|
5957
|
-
* @license
|
|
5958
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5959
|
-
*
|
|
5960
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
5961
|
-
* found in the LICENSE file at https://angular.io/license
|
|
5962
|
-
*/
|
|
5963
|
-
/**
|
|
5964
|
-
* Provides a strategy for setting the page title after a router navigation.
|
|
5965
|
-
*
|
|
5966
|
-
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
5967
|
-
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
5968
|
-
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
5969
|
-
* ```
|
|
5970
|
-
* [
|
|
5971
|
-
* {path: 'base', title: 'base', children: [
|
|
5972
|
-
* {path: 'child', title: 'child'},
|
|
5973
|
-
* ],
|
|
5974
|
-
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
5975
|
-
* ]
|
|
5976
|
-
* ```
|
|
5977
|
-
*
|
|
5978
|
-
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
5979
|
-
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
5980
|
-
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
5981
|
-
* incorporate titles in named outlets.
|
|
5982
|
-
*
|
|
5983
|
-
* @publicApi
|
|
5984
|
-
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
5985
|
-
*/
|
|
5986
|
-
class TitleStrategy {
|
|
5987
|
-
/**
|
|
5988
|
-
* @returns The `title` of the deepest primary route.
|
|
5989
|
-
*/
|
|
5990
|
-
buildTitle(snapshot) {
|
|
5991
|
-
var _a;
|
|
5992
|
-
let pageTitle;
|
|
5993
|
-
let route = snapshot.root;
|
|
5994
|
-
while (route !== undefined) {
|
|
5995
|
-
pageTitle = (_a = this.getResolvedTitleForRoute(route)) !== null && _a !== void 0 ? _a : pageTitle;
|
|
5996
|
-
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
5997
|
-
}
|
|
5998
|
-
return pageTitle;
|
|
5999
|
-
}
|
|
6000
|
-
/**
|
|
6001
|
-
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
6002
|
-
* `Route.title` property, which can either be a static string or a resolved value.
|
|
6003
|
-
*/
|
|
6004
|
-
getResolvedTitleForRoute(snapshot) {
|
|
6005
|
-
return snapshot.data[RouteTitle];
|
|
6006
|
-
}
|
|
6007
|
-
}
|
|
6008
|
-
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6009
|
-
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
6010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
6011
|
-
type: Injectable,
|
|
6012
|
-
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
6013
|
-
}] });
|
|
6014
|
-
/**
|
|
6015
|
-
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
6016
|
-
*/
|
|
6017
|
-
class DefaultTitleStrategy extends TitleStrategy {
|
|
6018
|
-
constructor(title) {
|
|
6019
|
-
super();
|
|
6020
|
-
this.title = title;
|
|
6021
|
-
}
|
|
6022
|
-
/**
|
|
6023
|
-
* Sets the title of the browser to the given value.
|
|
6024
|
-
*
|
|
6025
|
-
* @param title The `pageTitle` from the deepest primary route.
|
|
6026
|
-
*/
|
|
6027
|
-
updateTitle(snapshot) {
|
|
6028
|
-
const title = this.buildTitle(snapshot);
|
|
6029
|
-
if (title !== undefined) {
|
|
6030
|
-
this.title.setTitle(title);
|
|
6031
|
-
}
|
|
6032
|
-
}
|
|
6033
|
-
}
|
|
6034
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6035
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
6036
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
6037
|
-
type: Injectable,
|
|
6038
|
-
args: [{ providedIn: 'root' }]
|
|
6039
|
-
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
6040
|
-
|
|
6041
6146
|
/**
|
|
6042
6147
|
* @license
|
|
6043
6148
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6070,9 +6175,9 @@ class PreloadAllModules {
|
|
|
6070
6175
|
return fn().pipe(catchError(() => of(null)));
|
|
6071
6176
|
}
|
|
6072
6177
|
}
|
|
6073
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
6074
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
6075
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6178
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6179
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6076
6181
|
type: Injectable,
|
|
6077
6182
|
args: [{ providedIn: 'root' }]
|
|
6078
6183
|
}] });
|
|
@@ -6090,9 +6195,9 @@ class NoPreloading {
|
|
|
6090
6195
|
return of(null);
|
|
6091
6196
|
}
|
|
6092
6197
|
}
|
|
6093
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
6094
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
6095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6198
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6199
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6096
6201
|
type: Injectable,
|
|
6097
6202
|
args: [{ providedIn: 'root' }]
|
|
6098
6203
|
}] });
|
|
@@ -6140,7 +6245,15 @@ class RouterPreloader {
|
|
|
6140
6245
|
}
|
|
6141
6246
|
const injectorForCurrentRoute = (_a = route._injector) !== null && _a !== void 0 ? _a : injector;
|
|
6142
6247
|
const injectorForChildren = (_b = route._loadedInjector) !== null && _b !== void 0 ? _b : injectorForCurrentRoute;
|
|
6143
|
-
|
|
6248
|
+
// Note that `canLoad` is only checked as a condition that prevents `loadChildren` and not
|
|
6249
|
+
// `loadComponent`. `canLoad` guards only block loading of child routes by design. This
|
|
6250
|
+
// happens as a consequence of needing to descend into children for route matching immediately
|
|
6251
|
+
// while component loading is deferred until route activation. Because `canLoad` guards can
|
|
6252
|
+
// have side effects, we cannot execute them here so we instead skip preloading altogether
|
|
6253
|
+
// when present. Lastly, it remains to be decided whether `canLoad` should behave this way
|
|
6254
|
+
// at all. Code splitting and lazy loading is separate from client-side authorization checks
|
|
6255
|
+
// and should not be used as a security measure to prevent loading of code.
|
|
6256
|
+
if ((route.loadChildren && !route._loadedRoutes && route.canLoad === undefined) ||
|
|
6144
6257
|
(route.loadComponent && !route._loadedComponent)) {
|
|
6145
6258
|
res.push(this.preloadConfig(injectorForCurrentRoute, route));
|
|
6146
6259
|
}
|
|
@@ -6180,9 +6293,9 @@ class RouterPreloader {
|
|
|
6180
6293
|
});
|
|
6181
6294
|
}
|
|
6182
6295
|
}
|
|
6183
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
6184
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
6185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6296
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6297
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterPreloader });
|
|
6298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6186
6299
|
type: Injectable
|
|
6187
6300
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6188
6301
|
|
|
@@ -6262,9 +6375,9 @@ class RouterScroller {
|
|
|
6262
6375
|
}
|
|
6263
6376
|
}
|
|
6264
6377
|
}
|
|
6265
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
6266
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.
|
|
6267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6378
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6379
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterScroller });
|
|
6380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6268
6381
|
type: Injectable
|
|
6269
6382
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6270
6383
|
|
|
@@ -6280,36 +6393,26 @@ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
6280
6393
|
* The directives defined in the `RouterModule`.
|
|
6281
6394
|
*/
|
|
6282
6395
|
const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent];
|
|
6283
|
-
/**
|
|
6284
|
-
* A [DI token](guide/glossary/#di-token) for the router service.
|
|
6285
|
-
*
|
|
6286
|
-
* @publicApi
|
|
6287
|
-
*/
|
|
6288
|
-
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE ? 'router config' : 'ROUTER_CONFIGURATION', {
|
|
6289
|
-
providedIn: 'root',
|
|
6290
|
-
factory: () => ({}),
|
|
6291
|
-
});
|
|
6292
6396
|
/**
|
|
6293
6397
|
* @docsNotRequired
|
|
6294
6398
|
*/
|
|
6295
6399
|
const ROUTER_FORROOT_GUARD = new InjectionToken(NG_DEV_MODE ? 'router duplicate forRoot guard' : 'ROUTER_FORROOT_GUARD');
|
|
6296
6400
|
const ROUTER_PRELOADER = new InjectionToken(NG_DEV_MODE ? 'router preloader' : '');
|
|
6401
|
+
// TODO(atscott): All of these except `ActivatedRoute` are `providedIn: 'root'`. They are only kept
|
|
6402
|
+
// here to avoid a breaking change whereby the provider order matters based on where the
|
|
6403
|
+
// `RouterModule`/`RouterTestingModule` is imported. These can/should be removed as a "breaking"
|
|
6404
|
+
// change in a major version.
|
|
6297
6405
|
const ROUTER_PROVIDERS = [
|
|
6298
6406
|
Location,
|
|
6299
6407
|
{ provide: UrlSerializer, useClass: DefaultUrlSerializer },
|
|
6300
|
-
{
|
|
6301
|
-
provide: Router,
|
|
6302
|
-
useFactory: setupRouter,
|
|
6303
|
-
deps: [
|
|
6304
|
-
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES, TitleStrategy,
|
|
6305
|
-
ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
|
|
6306
|
-
[RouteReuseStrategy, new Optional()]
|
|
6307
|
-
]
|
|
6308
|
-
},
|
|
6408
|
+
{ provide: Router, useFactory: setupRouter },
|
|
6309
6409
|
ChildrenOutletContexts,
|
|
6310
6410
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6311
6411
|
RouterConfigLoader,
|
|
6312
6412
|
];
|
|
6413
|
+
function rootRoute(router) {
|
|
6414
|
+
return router.routerState.root;
|
|
6415
|
+
}
|
|
6313
6416
|
function routerNgProbeToken() {
|
|
6314
6417
|
return new NgProbeToken('Router', Router);
|
|
6315
6418
|
}
|
|
@@ -6335,8 +6438,7 @@ function routerNgProbeToken() {
|
|
|
6335
6438
|
* @publicApi
|
|
6336
6439
|
*/
|
|
6337
6440
|
class RouterModule {
|
|
6338
|
-
|
|
6339
|
-
constructor(guard, router) { }
|
|
6441
|
+
constructor(guard) { }
|
|
6340
6442
|
/**
|
|
6341
6443
|
* Creates and configures a module with all the router providers and directives.
|
|
6342
6444
|
* Optionally sets up an application listener to perform an initial navigation.
|
|
@@ -6397,10 +6499,10 @@ class RouterModule {
|
|
|
6397
6499
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6398
6500
|
}
|
|
6399
6501
|
}
|
|
6400
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.
|
|
6401
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.
|
|
6402
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.
|
|
6403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.
|
|
6502
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6503
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6504
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterModule });
|
|
6505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: RouterModule, decorators: [{
|
|
6404
6506
|
type: NgModule,
|
|
6405
6507
|
args: [{
|
|
6406
6508
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6412,8 +6514,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
|
|
|
6412
6514
|
}, {
|
|
6413
6515
|
type: Inject,
|
|
6414
6516
|
args: [ROUTER_FORROOT_GUARD]
|
|
6415
|
-
}] }, { type: Router, decorators: [{
|
|
6416
|
-
type: Optional
|
|
6417
6517
|
}] }];
|
|
6418
6518
|
} });
|
|
6419
6519
|
function provideRouterScroller() {
|
|
@@ -6438,7 +6538,8 @@ function providePathLocationStrategy() {
|
|
|
6438
6538
|
}
|
|
6439
6539
|
function provideForRootGuard(router) {
|
|
6440
6540
|
if (NG_DEV_MODE && router) {
|
|
6441
|
-
throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `
|
|
6541
|
+
throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `The Router was provided more than once. This can happen if 'forRoot' is used outside of the root injector.` +
|
|
6542
|
+
` Lazy loaded modules should use RouterModule.forChild() instead.`);
|
|
6442
6543
|
}
|
|
6443
6544
|
return 'guarded';
|
|
6444
6545
|
}
|
|
@@ -6460,48 +6561,9 @@ function provideForRootGuard(router) {
|
|
|
6460
6561
|
*/
|
|
6461
6562
|
function provideRoutes(routes) {
|
|
6462
6563
|
return [
|
|
6463
|
-
{ provide: ANALYZE_FOR_ENTRY_COMPONENTS, multi: true, useValue: routes },
|
|
6464
6564
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6465
6565
|
];
|
|
6466
6566
|
}
|
|
6467
|
-
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, titleStrategy, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
|
|
6468
|
-
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
6469
|
-
if (urlHandlingStrategy) {
|
|
6470
|
-
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
6471
|
-
}
|
|
6472
|
-
if (routeReuseStrategy) {
|
|
6473
|
-
router.routeReuseStrategy = routeReuseStrategy;
|
|
6474
|
-
}
|
|
6475
|
-
router.titleStrategy = titleStrategy;
|
|
6476
|
-
assignExtraOptionsToRouter(opts, router);
|
|
6477
|
-
return router;
|
|
6478
|
-
}
|
|
6479
|
-
function assignExtraOptionsToRouter(opts, router) {
|
|
6480
|
-
if (opts.errorHandler) {
|
|
6481
|
-
router.errorHandler = opts.errorHandler;
|
|
6482
|
-
}
|
|
6483
|
-
if (opts.malformedUriErrorHandler) {
|
|
6484
|
-
router.malformedUriErrorHandler = opts.malformedUriErrorHandler;
|
|
6485
|
-
}
|
|
6486
|
-
if (opts.onSameUrlNavigation) {
|
|
6487
|
-
router.onSameUrlNavigation = opts.onSameUrlNavigation;
|
|
6488
|
-
}
|
|
6489
|
-
if (opts.paramsInheritanceStrategy) {
|
|
6490
|
-
router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
|
|
6491
|
-
}
|
|
6492
|
-
if (opts.relativeLinkResolution) {
|
|
6493
|
-
router.relativeLinkResolution = opts.relativeLinkResolution;
|
|
6494
|
-
}
|
|
6495
|
-
if (opts.urlUpdateStrategy) {
|
|
6496
|
-
router.urlUpdateStrategy = opts.urlUpdateStrategy;
|
|
6497
|
-
}
|
|
6498
|
-
if (opts.canceledNavigationResolution) {
|
|
6499
|
-
router.canceledNavigationResolution = opts.canceledNavigationResolution;
|
|
6500
|
-
}
|
|
6501
|
-
}
|
|
6502
|
-
function rootRoute(router) {
|
|
6503
|
-
return router.routerState.root;
|
|
6504
|
-
}
|
|
6505
6567
|
function getBootstrapListener() {
|
|
6506
6568
|
const injector = inject(Injector);
|
|
6507
6569
|
return (bootstrappedComponentRef) => {
|
|
@@ -6512,8 +6574,7 @@ function getBootstrapListener() {
|
|
|
6512
6574
|
}
|
|
6513
6575
|
const router = injector.get(Router);
|
|
6514
6576
|
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6515
|
-
|
|
6516
|
-
if (injector.get(INITIAL_NAVIGATION, null, InjectFlags.Optional) === null) {
|
|
6577
|
+
if (injector.get(INITIAL_NAVIGATION) === 1 /* InitialNavigation.EnabledNonBlocking */) {
|
|
6517
6578
|
router.initialNavigation();
|
|
6518
6579
|
}
|
|
6519
6580
|
(_a = injector.get(ROUTER_PRELOADER, null, InjectFlags.Optional)) === null || _a === void 0 ? void 0 : _a.setUpPreloading();
|
|
@@ -6557,7 +6618,7 @@ const BOOTSTRAP_DONE = new InjectionToken(NG_DEV_MODE ? 'bootstrap done indicato
|
|
|
6557
6618
|
});
|
|
6558
6619
|
function provideEnabledBlockingInitialNavigation() {
|
|
6559
6620
|
return [
|
|
6560
|
-
{ provide: INITIAL_NAVIGATION, useValue:
|
|
6621
|
+
{ provide: INITIAL_NAVIGATION, useValue: 0 /* InitialNavigation.EnabledBlocking */ },
|
|
6561
6622
|
{
|
|
6562
6623
|
provide: APP_INITIALIZER,
|
|
6563
6624
|
multi: true,
|
|
@@ -6623,7 +6684,7 @@ function provideEnabledBlockingInitialNavigation() {
|
|
|
6623
6684
|
},
|
|
6624
6685
|
];
|
|
6625
6686
|
}
|
|
6626
|
-
const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE ? 'initial navigation' : '');
|
|
6687
|
+
const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE ? 'initial navigation' : '', { providedIn: 'root', factory: () => 1 /* InitialNavigation.EnabledNonBlocking */ });
|
|
6627
6688
|
function provideDisabledInitialNavigation() {
|
|
6628
6689
|
return [
|
|
6629
6690
|
{
|
|
@@ -6636,7 +6697,7 @@ function provideDisabledInitialNavigation() {
|
|
|
6636
6697
|
};
|
|
6637
6698
|
}
|
|
6638
6699
|
},
|
|
6639
|
-
{ provide: INITIAL_NAVIGATION, useValue:
|
|
6700
|
+
{ provide: INITIAL_NAVIGATION, useValue: 2 /* InitialNavigation.Disabled */ }
|
|
6640
6701
|
];
|
|
6641
6702
|
}
|
|
6642
6703
|
function provideTracing() {
|
|
@@ -6680,7 +6741,7 @@ function providePreloading(preloadingStrategy) {
|
|
|
6680
6741
|
/**
|
|
6681
6742
|
* @publicApi
|
|
6682
6743
|
*/
|
|
6683
|
-
const VERSION = new Version('14.1.
|
|
6744
|
+
const VERSION = new Version('14.1.3');
|
|
6684
6745
|
|
|
6685
6746
|
/**
|
|
6686
6747
|
* @license
|