@angular/router 14.0.4 → 14.0.7
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 +14 -18
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/create_url_tree.mjs +6 -4
- 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 +10 -9
- package/esm2020/src/errors.mjs +2 -0
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/operators/check_guards.mjs +12 -35
- package/esm2020/src/page_title_strategy.mjs +11 -5
- package/esm2020/src/recognize.mjs +3 -2
- package/esm2020/src/router.mjs +12 -10
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +57 -18
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/shared.mjs +3 -2
- package/esm2020/src/url_tree.mjs +6 -4
- package/esm2020/src/utils/config.mjs +17 -17
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +10 -12
- package/fesm2015/router.mjs +153 -132
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +10 -12
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +153 -132
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +10 -12
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +17 -3
- package/package.json +4 -4
- package/testing/index.d.ts +2 -3
- package/upgrade/index.d.ts +1 -1
package/fesm2020/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.7
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as i3 from '@angular/common';
|
|
8
8
|
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, ViewportScroller, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf,
|
|
10
|
+
import { ɵisObservable, ɵisPromise, ɵRuntimeError, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, inject, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
|
|
11
11
|
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
12
12
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, mapTo, finalize, refCount, defaultIfEmpty, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
@@ -519,9 +519,10 @@ class ParamsAsMap {
|
|
|
519
519
|
function convertToParamMap(params) {
|
|
520
520
|
return new ParamsAsMap(params);
|
|
521
521
|
}
|
|
522
|
+
const REDIRECTING_CANCELLATION_REASON = 'Redirecting to ';
|
|
522
523
|
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
|
|
523
524
|
function navigationCancelingError(message) {
|
|
524
|
-
const error = Error('NavigationCancelingError: ' + message);
|
|
525
|
+
const error = Error('NavigationCancelingError: ' + (message || ''));
|
|
525
526
|
error[NAVIGATION_CANCELING_ERROR] = true;
|
|
526
527
|
return error;
|
|
527
528
|
}
|
|
@@ -650,6 +651,7 @@ function wrapIntoObservable(value) {
|
|
|
650
651
|
* Use of this source code is governed by an MIT-style license that can be
|
|
651
652
|
* found in the LICENSE file at https://angular.io/license
|
|
652
653
|
*/
|
|
654
|
+
const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
653
655
|
function createEmptyUrlTree() {
|
|
654
656
|
return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
|
|
655
657
|
}
|
|
@@ -1114,7 +1116,7 @@ class UrlParser {
|
|
|
1114
1116
|
parseSegment() {
|
|
1115
1117
|
const path = matchSegments(this.remaining);
|
|
1116
1118
|
if (path === '' && this.peekStartsWith(';')) {
|
|
1117
|
-
throw new
|
|
1119
|
+
throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$7 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
|
|
1118
1120
|
}
|
|
1119
1121
|
this.capture(path);
|
|
1120
1122
|
return new UrlSegment(decode(path), this.parseMatrixParams());
|
|
@@ -1183,7 +1185,7 @@ class UrlParser {
|
|
|
1183
1185
|
// if is is not one of these characters, then the segment was unescaped
|
|
1184
1186
|
// or the group was not closed
|
|
1185
1187
|
if (next !== '/' && next !== ')' && next !== ';') {
|
|
1186
|
-
throw new
|
|
1188
|
+
throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$7 && `Cannot parse url '${this.url}'`);
|
|
1187
1189
|
}
|
|
1188
1190
|
let outletName = undefined;
|
|
1189
1191
|
if (path.indexOf(':') > -1) {
|
|
@@ -1214,7 +1216,7 @@ class UrlParser {
|
|
|
1214
1216
|
}
|
|
1215
1217
|
capture(str) {
|
|
1216
1218
|
if (!this.consumeOptional(str)) {
|
|
1217
|
-
throw new
|
|
1219
|
+
throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$7 && `Expected "${str}".`);
|
|
1218
1220
|
}
|
|
1219
1221
|
}
|
|
1220
1222
|
}
|
|
@@ -1767,6 +1769,7 @@ function createActivatedRoute(c) {
|
|
|
1767
1769
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1768
1770
|
* found in the LICENSE file at https://angular.io/license
|
|
1769
1771
|
*/
|
|
1772
|
+
const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
1770
1773
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
1771
1774
|
if (commands.length === 0) {
|
|
1772
1775
|
return tree(urlTree.root, urlTree.root, urlTree.root, queryParams, fragment);
|
|
@@ -1837,11 +1840,11 @@ class Navigation {
|
|
|
1837
1840
|
this.numberOfDoubleDots = numberOfDoubleDots;
|
|
1838
1841
|
this.commands = commands;
|
|
1839
1842
|
if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
|
|
1840
|
-
throw new
|
|
1843
|
+
throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$6 && 'Root segment cannot have matrix parameters');
|
|
1841
1844
|
}
|
|
1842
1845
|
const cmdWithOutlet = commands.find(isCommandWithOutlets);
|
|
1843
1846
|
if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
|
|
1844
|
-
throw new
|
|
1847
|
+
throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$6 && '{outlets:{}} has to be the last command');
|
|
1845
1848
|
}
|
|
1846
1849
|
}
|
|
1847
1850
|
toRoot() {
|
|
@@ -1922,7 +1925,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
|
|
|
1922
1925
|
dd -= ci;
|
|
1923
1926
|
g = g.parent;
|
|
1924
1927
|
if (!g) {
|
|
1925
|
-
throw new
|
|
1928
|
+
throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$6 && 'Invalid number of \'../\'');
|
|
1926
1929
|
}
|
|
1927
1930
|
ci = g.segments.length;
|
|
1928
1931
|
}
|
|
@@ -2154,6 +2157,7 @@ class ChildrenOutletContexts {
|
|
|
2154
2157
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2155
2158
|
* found in the LICENSE file at https://angular.io/license
|
|
2156
2159
|
*/
|
|
2160
|
+
const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
2157
2161
|
/**
|
|
2158
2162
|
* @description
|
|
2159
2163
|
*
|
|
@@ -2262,12 +2266,12 @@ class RouterOutlet {
|
|
|
2262
2266
|
*/
|
|
2263
2267
|
get component() {
|
|
2264
2268
|
if (!this.activated)
|
|
2265
|
-
throw new
|
|
2269
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
|
|
2266
2270
|
return this.activated.instance;
|
|
2267
2271
|
}
|
|
2268
2272
|
get activatedRoute() {
|
|
2269
2273
|
if (!this.activated)
|
|
2270
|
-
throw new
|
|
2274
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
|
|
2271
2275
|
return this._activatedRoute;
|
|
2272
2276
|
}
|
|
2273
2277
|
get activatedRouteData() {
|
|
@@ -2281,7 +2285,7 @@ class RouterOutlet {
|
|
|
2281
2285
|
*/
|
|
2282
2286
|
detach() {
|
|
2283
2287
|
if (!this.activated)
|
|
2284
|
-
throw new
|
|
2288
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
|
|
2285
2289
|
this.location.detach();
|
|
2286
2290
|
const cmp = this.activated;
|
|
2287
2291
|
this.activated = null;
|
|
@@ -2309,7 +2313,7 @@ class RouterOutlet {
|
|
|
2309
2313
|
}
|
|
2310
2314
|
activateWith(activatedRoute, resolverOrInjector) {
|
|
2311
2315
|
if (this.isActivated) {
|
|
2312
|
-
throw new
|
|
2316
|
+
throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$5 && 'Cannot activate an already activated outlet');
|
|
2313
2317
|
}
|
|
2314
2318
|
this._activatedRoute = activatedRoute;
|
|
2315
2319
|
const location = this.location;
|
|
@@ -2331,9 +2335,9 @@ class RouterOutlet {
|
|
|
2331
2335
|
this.activateEvents.emit(this.activated.instance);
|
|
2332
2336
|
}
|
|
2333
2337
|
}
|
|
2334
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2335
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
2336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2338
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2339
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2337
2341
|
type: Directive,
|
|
2338
2342
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2339
2343
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
@@ -2390,9 +2394,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2390
2394
|
*/
|
|
2391
2395
|
class ɵEmptyOutletComponent {
|
|
2392
2396
|
}
|
|
2393
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2394
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2397
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2398
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", 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"] }] });
|
|
2399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2396
2400
|
type: Component,
|
|
2397
2401
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2398
2402
|
}] });
|
|
@@ -2441,13 +2445,13 @@ function validateConfig(config, parentPath = '', requireStandaloneComponents = f
|
|
|
2441
2445
|
}
|
|
2442
2446
|
function assertStandalone(fullPath, component) {
|
|
2443
2447
|
if (component && !ɵisStandalone(component)) {
|
|
2444
|
-
throw new
|
|
2448
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}'. The component must be standalone.`);
|
|
2445
2449
|
}
|
|
2446
2450
|
}
|
|
2447
2451
|
function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
2448
2452
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2449
2453
|
if (!route) {
|
|
2450
|
-
throw new
|
|
2454
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `
|
|
2451
2455
|
Invalid configuration of route '${fullPath}': Encountered undefined route.
|
|
2452
2456
|
The reason might be an extra comma.
|
|
2453
2457
|
|
|
@@ -2460,47 +2464,47 @@ function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
|
2460
2464
|
`);
|
|
2461
2465
|
}
|
|
2462
2466
|
if (Array.isArray(route)) {
|
|
2463
|
-
throw new
|
|
2467
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': Array cannot be specified`);
|
|
2464
2468
|
}
|
|
2465
2469
|
if (!route.component && !route.loadComponent && !route.children && !route.loadChildren &&
|
|
2466
2470
|
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2467
|
-
throw new
|
|
2471
|
+
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`);
|
|
2468
2472
|
}
|
|
2469
2473
|
if (route.redirectTo && route.children) {
|
|
2470
|
-
throw new
|
|
2474
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);
|
|
2471
2475
|
}
|
|
2472
2476
|
if (route.redirectTo && route.loadChildren) {
|
|
2473
|
-
throw new
|
|
2477
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);
|
|
2474
2478
|
}
|
|
2475
2479
|
if (route.children && route.loadChildren) {
|
|
2476
|
-
throw new
|
|
2480
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
|
|
2477
2481
|
}
|
|
2478
2482
|
if (route.redirectTo && (route.component || route.loadComponent)) {
|
|
2479
|
-
throw new
|
|
2483
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`);
|
|
2480
2484
|
}
|
|
2481
2485
|
if (route.component && route.loadComponent) {
|
|
2482
|
-
throw new
|
|
2486
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`);
|
|
2483
2487
|
}
|
|
2484
2488
|
if (route.redirectTo && route.canActivate) {
|
|
2485
|
-
throw new
|
|
2489
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
|
|
2486
2490
|
`so canActivate will never be executed.`);
|
|
2487
2491
|
}
|
|
2488
2492
|
if (route.path && route.matcher) {
|
|
2489
|
-
throw new
|
|
2493
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
|
|
2490
2494
|
}
|
|
2491
2495
|
if (route.redirectTo === void 0 && !route.component && !route.loadComponent &&
|
|
2492
2496
|
!route.children && !route.loadChildren) {
|
|
2493
|
-
throw new
|
|
2497
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`);
|
|
2494
2498
|
}
|
|
2495
2499
|
if (route.path === void 0 && route.matcher === void 0) {
|
|
2496
|
-
throw new
|
|
2500
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
|
|
2497
2501
|
}
|
|
2498
2502
|
if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
|
|
2499
|
-
throw new
|
|
2503
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path cannot start with a slash`);
|
|
2500
2504
|
}
|
|
2501
2505
|
if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
|
|
2502
2506
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2503
|
-
throw new
|
|
2507
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2504
2508
|
}
|
|
2505
2509
|
if (requireStandaloneComponents) {
|
|
2506
2510
|
assertStandalone(fullPath, route.component);
|
|
@@ -2994,6 +2998,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
|
|
|
2994
2998
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2995
2999
|
* found in the LICENSE file at https://angular.io/license
|
|
2996
3000
|
*/
|
|
3001
|
+
const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
2997
3002
|
class NoMatch$1 {
|
|
2998
3003
|
constructor(segmentGroup) {
|
|
2999
3004
|
this.segmentGroup = segmentGroup || null;
|
|
@@ -3011,10 +3016,12 @@ function absoluteRedirect(newTree) {
|
|
|
3011
3016
|
return throwError(new AbsoluteRedirect(newTree));
|
|
3012
3017
|
}
|
|
3013
3018
|
function namedOutletsRedirect(redirectTo) {
|
|
3014
|
-
return throwError(new
|
|
3019
|
+
return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$4 &&
|
|
3020
|
+
`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
3015
3021
|
}
|
|
3016
3022
|
function canLoadFails(route) {
|
|
3017
|
-
return throwError(navigationCancelingError(
|
|
3023
|
+
return throwError(navigationCancelingError(NG_DEV_MODE$4 &&
|
|
3024
|
+
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
|
|
3018
3025
|
}
|
|
3019
3026
|
/**
|
|
3020
3027
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -3073,7 +3080,7 @@ class ApplyRedirects {
|
|
|
3073
3080
|
}));
|
|
3074
3081
|
}
|
|
3075
3082
|
noMatchError(e) {
|
|
3076
|
-
return new
|
|
3083
|
+
return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$4 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
|
|
3077
3084
|
}
|
|
3078
3085
|
createUrlTree(rootCandidate, queryParams, fragment) {
|
|
3079
3086
|
const root = rootCandidate.segments.length > 0 ?
|
|
@@ -3244,23 +3251,14 @@ class ApplyRedirects {
|
|
|
3244
3251
|
return of(true);
|
|
3245
3252
|
const canLoadObservables = canLoad.map((injectionToken) => {
|
|
3246
3253
|
const guard = injector.get(injectionToken);
|
|
3247
|
-
|
|
3248
|
-
if (isCanLoad(guard)) {
|
|
3249
|
-
guardVal = guard.canLoad(route, segments);
|
|
3250
|
-
}
|
|
3251
|
-
else if (isFunction(guard)) {
|
|
3252
|
-
guardVal = guard(route, segments);
|
|
3253
|
-
}
|
|
3254
|
-
else {
|
|
3255
|
-
throw new Error('Invalid CanLoad guard');
|
|
3256
|
-
}
|
|
3254
|
+
const guardVal = isCanLoad(guard) ? guard.canLoad(route, segments) : guard(route, segments);
|
|
3257
3255
|
return wrapIntoObservable(guardVal);
|
|
3258
3256
|
});
|
|
3259
3257
|
return of(canLoadObservables)
|
|
3260
3258
|
.pipe(prioritizedGuardValue(), tap((result) => {
|
|
3261
3259
|
if (!isUrlTree(result))
|
|
3262
3260
|
return;
|
|
3263
|
-
const error = navigationCancelingError(
|
|
3261
|
+
const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON + this.urlSerializer.serialize(result));
|
|
3264
3262
|
error.url = result;
|
|
3265
3263
|
throw error;
|
|
3266
3264
|
}), map(result => result === true));
|
|
@@ -3315,7 +3313,8 @@ class ApplyRedirects {
|
|
|
3315
3313
|
findPosParam(redirectTo, redirectToUrlSegment, posParams) {
|
|
3316
3314
|
const pos = posParams[redirectToUrlSegment.path.substring(1)];
|
|
3317
3315
|
if (!pos)
|
|
3318
|
-
throw new
|
|
3316
|
+
throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$4 &&
|
|
3317
|
+
`Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
|
|
3319
3318
|
return pos;
|
|
3320
3319
|
}
|
|
3321
3320
|
findOrReturn(redirectToUrlSegment, actualSegments) {
|
|
@@ -3584,17 +3583,9 @@ function runCanActivate(futureRSS, futureARS, moduleInjector) {
|
|
|
3584
3583
|
const canActivateObservables = canActivate.map((c) => {
|
|
3585
3584
|
return defer(() => {
|
|
3586
3585
|
const guard = getToken(c, futureARS, moduleInjector);
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
}
|
|
3591
|
-
else if (isFunction(guard)) {
|
|
3592
|
-
observable = wrapIntoObservable(guard(futureARS, futureRSS));
|
|
3593
|
-
}
|
|
3594
|
-
else {
|
|
3595
|
-
throw new Error('Invalid CanActivate guard');
|
|
3596
|
-
}
|
|
3597
|
-
return observable.pipe(first());
|
|
3586
|
+
const guardVal = isCanActivate(guard) ? guard.canActivate(futureARS, futureRSS) :
|
|
3587
|
+
guard(futureARS, futureRSS);
|
|
3588
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3598
3589
|
});
|
|
3599
3590
|
});
|
|
3600
3591
|
return of(canActivateObservables).pipe(prioritizedGuardValue());
|
|
@@ -3609,17 +3600,9 @@ function runCanActivateChild(futureRSS, path, moduleInjector) {
|
|
|
3609
3600
|
return defer(() => {
|
|
3610
3601
|
const guardsMapped = d.guards.map((c) => {
|
|
3611
3602
|
const guard = getToken(c, d.node, moduleInjector);
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
}
|
|
3616
|
-
else if (isFunction(guard)) {
|
|
3617
|
-
observable = wrapIntoObservable(guard(futureARS, futureRSS));
|
|
3618
|
-
}
|
|
3619
|
-
else {
|
|
3620
|
-
throw new Error('Invalid CanActivateChild guard');
|
|
3621
|
-
}
|
|
3622
|
-
return observable.pipe(first());
|
|
3603
|
+
const guardVal = isCanActivateChild(guard) ? guard.canActivateChild(futureARS, futureRSS) :
|
|
3604
|
+
guard(futureARS, futureRSS);
|
|
3605
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3623
3606
|
});
|
|
3624
3607
|
return of(guardsMapped).pipe(prioritizedGuardValue());
|
|
3625
3608
|
});
|
|
@@ -3632,17 +3615,10 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
|
|
|
3632
3615
|
return of(true);
|
|
3633
3616
|
const canDeactivateObservables = canDeactivate.map((c) => {
|
|
3634
3617
|
const guard = getToken(c, currARS, moduleInjector);
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
else if (isFunction(guard)) {
|
|
3640
|
-
observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));
|
|
3641
|
-
}
|
|
3642
|
-
else {
|
|
3643
|
-
throw new Error('Invalid CanDeactivate guard');
|
|
3644
|
-
}
|
|
3645
|
-
return observable.pipe(first());
|
|
3618
|
+
const guardVal = isCanDeactivate(guard) ?
|
|
3619
|
+
guard.canDeactivate(component, currARS, currRSS, futureRSS) :
|
|
3620
|
+
guard(component, currARS, currRSS, futureRSS);
|
|
3621
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3646
3622
|
});
|
|
3647
3623
|
return of(canDeactivateObservables).pipe(prioritizedGuardValue());
|
|
3648
3624
|
}
|
|
@@ -3883,7 +3859,7 @@ function checkOutletNameUniqueness(nodes) {
|
|
|
3883
3859
|
if (routeWithSameOutletName) {
|
|
3884
3860
|
const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
|
|
3885
3861
|
const c = n.value.url.map(s => s.toString()).join('/');
|
|
3886
|
-
throw new
|
|
3862
|
+
throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$3 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
|
|
3887
3863
|
}
|
|
3888
3864
|
names[n.value.outlet] = n.value;
|
|
3889
3865
|
});
|
|
@@ -4189,9 +4165,9 @@ class RouterConfigLoader {
|
|
|
4189
4165
|
}));
|
|
4190
4166
|
}
|
|
4191
4167
|
}
|
|
4192
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
4193
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
4194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
4168
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4169
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader });
|
|
4170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4195
4171
|
type: Injectable
|
|
4196
4172
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4197
4173
|
|
|
@@ -4286,6 +4262,7 @@ class Router {
|
|
|
4286
4262
|
this.lastSuccessfulNavigation = null;
|
|
4287
4263
|
this.currentNavigation = null;
|
|
4288
4264
|
this.disposed = false;
|
|
4265
|
+
/** @internal */
|
|
4289
4266
|
this.navigationId = 0;
|
|
4290
4267
|
/**
|
|
4291
4268
|
* The id of the currently active page in the router.
|
|
@@ -4558,7 +4535,8 @@ class Router {
|
|
|
4558
4535
|
guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts)
|
|
4559
4536
|
})), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
|
|
4560
4537
|
if (isUrlTree(t.guardsResult)) {
|
|
4561
|
-
const error = navigationCancelingError(
|
|
4538
|
+
const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON +
|
|
4539
|
+
`"${this.serializeUrl(t.guardsResult)}"`);
|
|
4562
4540
|
error.url = t.guardsResult;
|
|
4563
4541
|
throw error;
|
|
4564
4542
|
}
|
|
@@ -4595,7 +4573,7 @@ class Router {
|
|
|
4595
4573
|
}));
|
|
4596
4574
|
}
|
|
4597
4575
|
return undefined;
|
|
4598
|
-
}),
|
|
4576
|
+
}),
|
|
4599
4577
|
// --- LOAD COMPONENTS ---
|
|
4600
4578
|
switchTap((t) => {
|
|
4601
4579
|
const loadComponents = (route) => {
|
|
@@ -4614,7 +4592,7 @@ class Router {
|
|
|
4614
4592
|
};
|
|
4615
4593
|
return combineLatest(loadComponents(t.targetSnapshot.root))
|
|
4616
4594
|
.pipe(defaultIfEmpty(), take(1));
|
|
4617
|
-
}), map((t) => {
|
|
4595
|
+
}), switchTap(() => this.afterPreactivation()), map((t) => {
|
|
4618
4596
|
const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4619
4597
|
return ({ ...t, targetRouterState });
|
|
4620
4598
|
}),
|
|
@@ -5167,16 +5145,16 @@ class Router {
|
|
|
5167
5145
|
return { navigationId };
|
|
5168
5146
|
}
|
|
5169
5147
|
}
|
|
5170
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5171
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5148
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5149
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router });
|
|
5150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: Router, decorators: [{
|
|
5173
5151
|
type: Injectable
|
|
5174
5152
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5175
5153
|
function validateCommands(commands) {
|
|
5176
5154
|
for (let i = 0; i < commands.length; i++) {
|
|
5177
5155
|
const cmd = commands[i];
|
|
5178
5156
|
if (cmd == null) {
|
|
5179
|
-
throw new
|
|
5157
|
+
throw new ɵRuntimeError(4008 /* RuntimeErrorCode.NULLISH_COMMAND */, NG_DEV_MODE$1 && `The requested path contains ${cmd} segment at index ${i}`);
|
|
5180
5158
|
}
|
|
5181
5159
|
}
|
|
5182
5160
|
}
|
|
@@ -5368,9 +5346,9 @@ class RouterLink {
|
|
|
5368
5346
|
});
|
|
5369
5347
|
}
|
|
5370
5348
|
}
|
|
5371
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5372
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
5373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5349
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5350
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", 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 });
|
|
5351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLink, decorators: [{
|
|
5374
5352
|
type: Directive,
|
|
5375
5353
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5376
5354
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5487,9 +5465,9 @@ class RouterLinkWithHref {
|
|
|
5487
5465
|
});
|
|
5488
5466
|
}
|
|
5489
5467
|
}
|
|
5490
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5491
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
5492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5468
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5469
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", 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 });
|
|
5470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5493
5471
|
type: Directive,
|
|
5494
5472
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5495
5473
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5714,9 +5692,9 @@ class RouterLinkActive {
|
|
|
5714
5692
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5715
5693
|
}
|
|
5716
5694
|
}
|
|
5717
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5718
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
5719
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5695
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", 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 });
|
|
5696
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", 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 });
|
|
5697
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5720
5698
|
type: Directive,
|
|
5721
5699
|
args: [{
|
|
5722
5700
|
selector: '[routerLinkActive]',
|
|
@@ -5799,6 +5777,12 @@ class TitleStrategy {
|
|
|
5799
5777
|
return snapshot.data[RouteTitle];
|
|
5800
5778
|
}
|
|
5801
5779
|
}
|
|
5780
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5781
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
5782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
5783
|
+
type: Injectable,
|
|
5784
|
+
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
5785
|
+
}] });
|
|
5802
5786
|
/**
|
|
5803
5787
|
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
5804
5788
|
*/
|
|
@@ -5819,9 +5803,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5819
5803
|
}
|
|
5820
5804
|
}
|
|
5821
5805
|
}
|
|
5822
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5823
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5824
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5806
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5807
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5825
5809
|
type: Injectable,
|
|
5826
5810
|
args: [{ providedIn: 'root' }]
|
|
5827
5811
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -5858,9 +5842,9 @@ class PreloadAllModules {
|
|
|
5858
5842
|
return fn().pipe(catchError(() => of(null)));
|
|
5859
5843
|
}
|
|
5860
5844
|
}
|
|
5861
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5862
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5845
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5846
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
5847
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
5864
5848
|
type: Injectable,
|
|
5865
5849
|
args: [{ providedIn: 'root' }]
|
|
5866
5850
|
}] });
|
|
@@ -5878,9 +5862,9 @@ class NoPreloading {
|
|
|
5878
5862
|
return of(null);
|
|
5879
5863
|
}
|
|
5880
5864
|
}
|
|
5881
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5882
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5883
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5865
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5866
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
5867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: NoPreloading, decorators: [{
|
|
5884
5868
|
type: Injectable,
|
|
5885
5869
|
args: [{ providedIn: 'root' }]
|
|
5886
5870
|
}] });
|
|
@@ -5966,9 +5950,9 @@ class RouterPreloader {
|
|
|
5966
5950
|
});
|
|
5967
5951
|
}
|
|
5968
5952
|
}
|
|
5969
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5970
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5971
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5953
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5954
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader });
|
|
5955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5972
5956
|
type: Injectable
|
|
5973
5957
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
5974
5958
|
|
|
@@ -6055,9 +6039,9 @@ class RouterScroller {
|
|
|
6055
6039
|
}
|
|
6056
6040
|
}
|
|
6057
6041
|
}
|
|
6058
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
6059
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
6060
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
6042
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6043
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller });
|
|
6044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6061
6045
|
type: Injectable
|
|
6062
6046
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6063
6047
|
|
|
@@ -6094,9 +6078,9 @@ const ROUTER_PROVIDERS = [
|
|
|
6094
6078
|
provide: Router,
|
|
6095
6079
|
useFactory: setupRouter,
|
|
6096
6080
|
deps: [
|
|
6097
|
-
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES,
|
|
6098
|
-
ROUTER_CONFIGURATION,
|
|
6099
|
-
[
|
|
6081
|
+
UrlSerializer, ChildrenOutletContexts, Location, Injector, Compiler, ROUTES, TitleStrategy,
|
|
6082
|
+
ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()],
|
|
6083
|
+
[RouteReuseStrategy, new Optional()]
|
|
6100
6084
|
]
|
|
6101
6085
|
},
|
|
6102
6086
|
ChildrenOutletContexts,
|
|
@@ -6190,10 +6174,10 @@ class RouterModule {
|
|
|
6190
6174
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6191
6175
|
}
|
|
6192
6176
|
}
|
|
6193
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
6194
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.
|
|
6195
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.
|
|
6196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
6177
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6178
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6179
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule });
|
|
6180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: RouterModule, decorators: [{
|
|
6197
6181
|
type: NgModule,
|
|
6198
6182
|
args: [{
|
|
6199
6183
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6229,7 +6213,7 @@ function providePathLocationStrategy() {
|
|
|
6229
6213
|
}
|
|
6230
6214
|
function provideForRootGuard(router) {
|
|
6231
6215
|
if (NG_DEV_MODE && router) {
|
|
6232
|
-
throw new
|
|
6216
|
+
throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
|
|
6233
6217
|
}
|
|
6234
6218
|
return 'guarded';
|
|
6235
6219
|
}
|
|
@@ -6255,7 +6239,7 @@ function provideRoutes(routes) {
|
|
|
6255
6239
|
{ provide: ROUTES, multi: true, useValue: routes },
|
|
6256
6240
|
];
|
|
6257
6241
|
}
|
|
6258
|
-
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, opts = {},
|
|
6242
|
+
function setupRouter(urlSerializer, contexts, location, injector, compiler, config, titleStrategy, opts = {}, urlHandlingStrategy, routeReuseStrategy) {
|
|
6259
6243
|
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, flatten(config));
|
|
6260
6244
|
if (urlHandlingStrategy) {
|
|
6261
6245
|
router.urlHandlingStrategy = urlHandlingStrategy;
|
|
@@ -6263,7 +6247,7 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
|
|
|
6263
6247
|
if (routeReuseStrategy) {
|
|
6264
6248
|
router.routeReuseStrategy = routeReuseStrategy;
|
|
6265
6249
|
}
|
|
6266
|
-
router.titleStrategy = titleStrategy
|
|
6250
|
+
router.titleStrategy = titleStrategy;
|
|
6267
6251
|
assignExtraOptionsToRouter(opts, router);
|
|
6268
6252
|
return router;
|
|
6269
6253
|
}
|
|
@@ -6355,17 +6339,54 @@ function provideEnabledBlockingInitialNavigation() {
|
|
|
6355
6339
|
useFactory: (injector) => {
|
|
6356
6340
|
const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6357
6341
|
let initNavigation = false;
|
|
6342
|
+
/**
|
|
6343
|
+
* Performs the given action once the router finishes its next/current navigation.
|
|
6344
|
+
*
|
|
6345
|
+
* If the navigation is canceled or errors without a redirect, the navigation is considered
|
|
6346
|
+
* complete. If the `NavigationEnd` event emits, the navigation is also considered complete.
|
|
6347
|
+
*/
|
|
6348
|
+
function afterNextNavigation(action) {
|
|
6349
|
+
const router = injector.get(Router);
|
|
6350
|
+
router.events
|
|
6351
|
+
.pipe(filter((e) => e instanceof NavigationEnd || e instanceof NavigationCancel ||
|
|
6352
|
+
e instanceof NavigationError), map(e => {
|
|
6353
|
+
if (e instanceof NavigationEnd) {
|
|
6354
|
+
// Navigation assumed to succeed if we get `ActivationStart`
|
|
6355
|
+
return true;
|
|
6356
|
+
}
|
|
6357
|
+
const newNavigationStarted = router.navigationId !== e.id;
|
|
6358
|
+
// TODO(atscott): Do not rely on the string reason to determine if cancelation
|
|
6359
|
+
// is redirecting
|
|
6360
|
+
const redirectingWithUrlTree = e instanceof NavigationCancel ?
|
|
6361
|
+
e.reason.indexOf(REDIRECTING_CANCELLATION_REASON) !== -1 :
|
|
6362
|
+
false;
|
|
6363
|
+
// Navigation failed, but if we already have a new navigation, wait for the
|
|
6364
|
+
// result of that one instead.
|
|
6365
|
+
return newNavigationStarted || redirectingWithUrlTree ? null : false;
|
|
6366
|
+
}), filter((result) => result !== null), take(1))
|
|
6367
|
+
.subscribe(() => {
|
|
6368
|
+
action();
|
|
6369
|
+
});
|
|
6370
|
+
}
|
|
6358
6371
|
return () => {
|
|
6359
6372
|
return locationInitialized.then(() => {
|
|
6360
6373
|
return new Promise(resolve => {
|
|
6361
6374
|
const router = injector.get(Router);
|
|
6362
6375
|
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6376
|
+
afterNextNavigation(() => {
|
|
6377
|
+
// Unblock APP_INITIALIZER in case the initial navigation was canceled or errored
|
|
6378
|
+
// without a redirect.
|
|
6379
|
+
resolve(true);
|
|
6380
|
+
initNavigation = true;
|
|
6381
|
+
});
|
|
6363
6382
|
router.afterPreactivation = () => {
|
|
6364
|
-
//
|
|
6383
|
+
// Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we
|
|
6384
|
+
// assume activation will complete successfully (even though this is not
|
|
6385
|
+
// guaranteed).
|
|
6386
|
+
resolve(true);
|
|
6387
|
+
// only the initial navigation should be delayed until bootstrapping is done.
|
|
6365
6388
|
if (!initNavigation) {
|
|
6366
|
-
|
|
6367
|
-
resolve(true);
|
|
6368
|
-
return bootstrapDone;
|
|
6389
|
+
return bootstrapDone.closed ? of(void 0) : bootstrapDone;
|
|
6369
6390
|
// subsequent navigations should not be delayed
|
|
6370
6391
|
}
|
|
6371
6392
|
else {
|
|
@@ -6436,7 +6457,7 @@ function providePreloading(preloadingStrategy) {
|
|
|
6436
6457
|
/**
|
|
6437
6458
|
* @publicApi
|
|
6438
6459
|
*/
|
|
6439
|
-
const VERSION = new Version('14.0.
|
|
6460
|
+
const VERSION = new Version('14.0.7');
|
|
6440
6461
|
|
|
6441
6462
|
/**
|
|
6442
6463
|
* @license
|