@angular/router 14.0.4 → 14.0.5
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 +3 -3
- 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 +51 -12
- 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 +4 -4
- package/fesm2015/router.mjs +142 -127
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +142 -127
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +15 -3
- 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,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.5
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
|
|
8
|
+
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, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, mapTo, finalize, refCount, defaultIfEmpty, mergeAll } from 'rxjs/operators';
|
|
11
11
|
import * as i3 from '@angular/common';
|
|
@@ -520,9 +520,10 @@ class ParamsAsMap {
|
|
|
520
520
|
function convertToParamMap(params) {
|
|
521
521
|
return new ParamsAsMap(params);
|
|
522
522
|
}
|
|
523
|
+
const REDIRECTING_CANCELLATION_REASON = 'Redirecting to ';
|
|
523
524
|
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
|
|
524
525
|
function navigationCancelingError(message) {
|
|
525
|
-
const error = Error('NavigationCancelingError: ' + message);
|
|
526
|
+
const error = Error('NavigationCancelingError: ' + (message || ''));
|
|
526
527
|
error[NAVIGATION_CANCELING_ERROR] = true;
|
|
527
528
|
return error;
|
|
528
529
|
}
|
|
@@ -651,6 +652,7 @@ function wrapIntoObservable(value) {
|
|
|
651
652
|
* Use of this source code is governed by an MIT-style license that can be
|
|
652
653
|
* found in the LICENSE file at https://angular.io/license
|
|
653
654
|
*/
|
|
655
|
+
const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
654
656
|
function createEmptyUrlTree() {
|
|
655
657
|
return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
|
|
656
658
|
}
|
|
@@ -1115,7 +1117,7 @@ class UrlParser {
|
|
|
1115
1117
|
parseSegment() {
|
|
1116
1118
|
const path = matchSegments(this.remaining);
|
|
1117
1119
|
if (path === '' && this.peekStartsWith(';')) {
|
|
1118
|
-
throw new
|
|
1120
|
+
throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$7 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
|
|
1119
1121
|
}
|
|
1120
1122
|
this.capture(path);
|
|
1121
1123
|
return new UrlSegment(decode(path), this.parseMatrixParams());
|
|
@@ -1184,7 +1186,7 @@ class UrlParser {
|
|
|
1184
1186
|
// if is is not one of these characters, then the segment was unescaped
|
|
1185
1187
|
// or the group was not closed
|
|
1186
1188
|
if (next !== '/' && next !== ')' && next !== ';') {
|
|
1187
|
-
throw new
|
|
1189
|
+
throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$7 && `Cannot parse url '${this.url}'`);
|
|
1188
1190
|
}
|
|
1189
1191
|
let outletName = undefined;
|
|
1190
1192
|
if (path.indexOf(':') > -1) {
|
|
@@ -1215,7 +1217,7 @@ class UrlParser {
|
|
|
1215
1217
|
}
|
|
1216
1218
|
capture(str) {
|
|
1217
1219
|
if (!this.consumeOptional(str)) {
|
|
1218
|
-
throw new
|
|
1220
|
+
throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$7 && `Expected "${str}".`);
|
|
1219
1221
|
}
|
|
1220
1222
|
}
|
|
1221
1223
|
}
|
|
@@ -1769,6 +1771,7 @@ function createActivatedRoute(c) {
|
|
|
1769
1771
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1770
1772
|
* found in the LICENSE file at https://angular.io/license
|
|
1771
1773
|
*/
|
|
1774
|
+
const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
1772
1775
|
function createUrlTree(route, urlTree, commands, queryParams, fragment) {
|
|
1773
1776
|
var _a, _b;
|
|
1774
1777
|
if (commands.length === 0) {
|
|
@@ -1841,11 +1844,11 @@ class Navigation {
|
|
|
1841
1844
|
this.numberOfDoubleDots = numberOfDoubleDots;
|
|
1842
1845
|
this.commands = commands;
|
|
1843
1846
|
if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
|
|
1844
|
-
throw new
|
|
1847
|
+
throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$6 && 'Root segment cannot have matrix parameters');
|
|
1845
1848
|
}
|
|
1846
1849
|
const cmdWithOutlet = commands.find(isCommandWithOutlets);
|
|
1847
1850
|
if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
|
|
1848
|
-
throw new
|
|
1851
|
+
throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$6 && '{outlets:{}} has to be the last command');
|
|
1849
1852
|
}
|
|
1850
1853
|
}
|
|
1851
1854
|
toRoot() {
|
|
@@ -1926,7 +1929,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
|
|
|
1926
1929
|
dd -= ci;
|
|
1927
1930
|
g = g.parent;
|
|
1928
1931
|
if (!g) {
|
|
1929
|
-
throw new
|
|
1932
|
+
throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$6 && 'Invalid number of \'../\'');
|
|
1930
1933
|
}
|
|
1931
1934
|
ci = g.segments.length;
|
|
1932
1935
|
}
|
|
@@ -2158,6 +2161,7 @@ class ChildrenOutletContexts {
|
|
|
2158
2161
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2159
2162
|
* found in the LICENSE file at https://angular.io/license
|
|
2160
2163
|
*/
|
|
2164
|
+
const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
2161
2165
|
/**
|
|
2162
2166
|
* @description
|
|
2163
2167
|
*
|
|
@@ -2267,12 +2271,12 @@ class RouterOutlet {
|
|
|
2267
2271
|
*/
|
|
2268
2272
|
get component() {
|
|
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.activated.instance;
|
|
2272
2276
|
}
|
|
2273
2277
|
get activatedRoute() {
|
|
2274
2278
|
if (!this.activated)
|
|
2275
|
-
throw new
|
|
2279
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
|
|
2276
2280
|
return this._activatedRoute;
|
|
2277
2281
|
}
|
|
2278
2282
|
get activatedRouteData() {
|
|
@@ -2286,7 +2290,7 @@ class RouterOutlet {
|
|
|
2286
2290
|
*/
|
|
2287
2291
|
detach() {
|
|
2288
2292
|
if (!this.activated)
|
|
2289
|
-
throw new
|
|
2293
|
+
throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$5 && 'Outlet is not activated');
|
|
2290
2294
|
this.location.detach();
|
|
2291
2295
|
const cmp = this.activated;
|
|
2292
2296
|
this.activated = null;
|
|
@@ -2314,7 +2318,7 @@ class RouterOutlet {
|
|
|
2314
2318
|
}
|
|
2315
2319
|
activateWith(activatedRoute, resolverOrInjector) {
|
|
2316
2320
|
if (this.isActivated) {
|
|
2317
|
-
throw new
|
|
2321
|
+
throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$5 && 'Cannot activate an already activated outlet');
|
|
2318
2322
|
}
|
|
2319
2323
|
this._activatedRoute = activatedRoute;
|
|
2320
2324
|
const location = this.location;
|
|
@@ -2336,9 +2340,9 @@ class RouterOutlet {
|
|
|
2336
2340
|
this.activateEvents.emit(this.activated.instance);
|
|
2337
2341
|
}
|
|
2338
2342
|
}
|
|
2339
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2340
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
2341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2343
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2344
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.5", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2345
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2342
2346
|
type: Directive,
|
|
2343
2347
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2344
2348
|
}], ctorParameters: function () {
|
|
@@ -2397,9 +2401,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2397
2401
|
*/
|
|
2398
2402
|
class ɵEmptyOutletComponent {
|
|
2399
2403
|
}
|
|
2400
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
2401
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.
|
|
2402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
2404
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2405
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", 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"] }] });
|
|
2406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2403
2407
|
type: Component,
|
|
2404
2408
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2405
2409
|
}] });
|
|
@@ -2449,13 +2453,13 @@ function validateConfig(config, parentPath = '', requireStandaloneComponents = f
|
|
|
2449
2453
|
}
|
|
2450
2454
|
function assertStandalone(fullPath, component) {
|
|
2451
2455
|
if (component && !ɵisStandalone(component)) {
|
|
2452
|
-
throw new
|
|
2456
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}'. The component must be standalone.`);
|
|
2453
2457
|
}
|
|
2454
2458
|
}
|
|
2455
2459
|
function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
2456
2460
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2457
2461
|
if (!route) {
|
|
2458
|
-
throw new
|
|
2462
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `
|
|
2459
2463
|
Invalid configuration of route '${fullPath}': Encountered undefined route.
|
|
2460
2464
|
The reason might be an extra comma.
|
|
2461
2465
|
|
|
@@ -2468,47 +2472,47 @@ function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
|
2468
2472
|
`);
|
|
2469
2473
|
}
|
|
2470
2474
|
if (Array.isArray(route)) {
|
|
2471
|
-
throw new
|
|
2475
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': Array cannot be specified`);
|
|
2472
2476
|
}
|
|
2473
2477
|
if (!route.component && !route.loadComponent && !route.children && !route.loadChildren &&
|
|
2474
2478
|
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2475
|
-
throw new
|
|
2479
|
+
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`);
|
|
2476
2480
|
}
|
|
2477
2481
|
if (route.redirectTo && route.children) {
|
|
2478
|
-
throw new
|
|
2482
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and children cannot be used together`);
|
|
2479
2483
|
}
|
|
2480
2484
|
if (route.redirectTo && route.loadChildren) {
|
|
2481
|
-
throw new
|
|
2485
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and loadChildren cannot be used together`);
|
|
2482
2486
|
}
|
|
2483
2487
|
if (route.children && route.loadChildren) {
|
|
2484
|
-
throw new
|
|
2488
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
|
|
2485
2489
|
}
|
|
2486
2490
|
if (route.redirectTo && (route.component || route.loadComponent)) {
|
|
2487
|
-
throw new
|
|
2491
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`);
|
|
2488
2492
|
}
|
|
2489
2493
|
if (route.component && route.loadComponent) {
|
|
2490
|
-
throw new
|
|
2494
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`);
|
|
2491
2495
|
}
|
|
2492
2496
|
if (route.redirectTo && route.canActivate) {
|
|
2493
|
-
throw new
|
|
2497
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
|
|
2494
2498
|
`so canActivate will never be executed.`);
|
|
2495
2499
|
}
|
|
2496
2500
|
if (route.path && route.matcher) {
|
|
2497
|
-
throw new
|
|
2501
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
|
|
2498
2502
|
}
|
|
2499
2503
|
if (route.redirectTo === void 0 && !route.component && !route.loadComponent &&
|
|
2500
2504
|
!route.children && !route.loadChildren) {
|
|
2501
|
-
throw new
|
|
2505
|
+
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`);
|
|
2502
2506
|
}
|
|
2503
2507
|
if (route.path === void 0 && route.matcher === void 0) {
|
|
2504
|
-
throw new
|
|
2508
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
|
|
2505
2509
|
}
|
|
2506
2510
|
if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
|
|
2507
|
-
throw new
|
|
2511
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '${fullPath}': path cannot start with a slash`);
|
|
2508
2512
|
}
|
|
2509
2513
|
if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
|
|
2510
2514
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2511
|
-
throw new
|
|
2515
|
+
throw new ɵRuntimeError(4014 /* RuntimeErrorCode.INVALID_ROUTE_CONFIG */, `Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2512
2516
|
}
|
|
2513
2517
|
if (requireStandaloneComponents) {
|
|
2514
2518
|
assertStandalone(fullPath, route.component);
|
|
@@ -3004,6 +3008,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
|
|
|
3004
3008
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3005
3009
|
* found in the LICENSE file at https://angular.io/license
|
|
3006
3010
|
*/
|
|
3011
|
+
const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
3007
3012
|
class NoMatch$1 {
|
|
3008
3013
|
constructor(segmentGroup) {
|
|
3009
3014
|
this.segmentGroup = segmentGroup || null;
|
|
@@ -3021,10 +3026,12 @@ function absoluteRedirect(newTree) {
|
|
|
3021
3026
|
return throwError(new AbsoluteRedirect(newTree));
|
|
3022
3027
|
}
|
|
3023
3028
|
function namedOutletsRedirect(redirectTo) {
|
|
3024
|
-
return throwError(new
|
|
3029
|
+
return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$4 &&
|
|
3030
|
+
`Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
|
|
3025
3031
|
}
|
|
3026
3032
|
function canLoadFails(route) {
|
|
3027
|
-
return throwError(navigationCancelingError(
|
|
3033
|
+
return throwError(navigationCancelingError(NG_DEV_MODE$4 &&
|
|
3034
|
+
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`));
|
|
3028
3035
|
}
|
|
3029
3036
|
/**
|
|
3030
3037
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -3083,7 +3090,7 @@ class ApplyRedirects {
|
|
|
3083
3090
|
}));
|
|
3084
3091
|
}
|
|
3085
3092
|
noMatchError(e) {
|
|
3086
|
-
return new
|
|
3093
|
+
return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$4 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
|
|
3087
3094
|
}
|
|
3088
3095
|
createUrlTree(rootCandidate, queryParams, fragment) {
|
|
3089
3096
|
const root = rootCandidate.segments.length > 0 ?
|
|
@@ -3255,23 +3262,14 @@ class ApplyRedirects {
|
|
|
3255
3262
|
return of(true);
|
|
3256
3263
|
const canLoadObservables = canLoad.map((injectionToken) => {
|
|
3257
3264
|
const guard = injector.get(injectionToken);
|
|
3258
|
-
|
|
3259
|
-
if (isCanLoad(guard)) {
|
|
3260
|
-
guardVal = guard.canLoad(route, segments);
|
|
3261
|
-
}
|
|
3262
|
-
else if (isFunction(guard)) {
|
|
3263
|
-
guardVal = guard(route, segments);
|
|
3264
|
-
}
|
|
3265
|
-
else {
|
|
3266
|
-
throw new Error('Invalid CanLoad guard');
|
|
3267
|
-
}
|
|
3265
|
+
const guardVal = isCanLoad(guard) ? guard.canLoad(route, segments) : guard(route, segments);
|
|
3268
3266
|
return wrapIntoObservable(guardVal);
|
|
3269
3267
|
});
|
|
3270
3268
|
return of(canLoadObservables)
|
|
3271
3269
|
.pipe(prioritizedGuardValue(), tap((result) => {
|
|
3272
3270
|
if (!isUrlTree(result))
|
|
3273
3271
|
return;
|
|
3274
|
-
const error = navigationCancelingError(
|
|
3272
|
+
const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON + this.urlSerializer.serialize(result));
|
|
3275
3273
|
error.url = result;
|
|
3276
3274
|
throw error;
|
|
3277
3275
|
}), map(result => result === true));
|
|
@@ -3326,7 +3324,8 @@ class ApplyRedirects {
|
|
|
3326
3324
|
findPosParam(redirectTo, redirectToUrlSegment, posParams) {
|
|
3327
3325
|
const pos = posParams[redirectToUrlSegment.path.substring(1)];
|
|
3328
3326
|
if (!pos)
|
|
3329
|
-
throw new
|
|
3327
|
+
throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$4 &&
|
|
3328
|
+
`Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
|
|
3330
3329
|
return pos;
|
|
3331
3330
|
}
|
|
3332
3331
|
findOrReturn(redirectToUrlSegment, actualSegments) {
|
|
@@ -3595,17 +3594,9 @@ function runCanActivate(futureRSS, futureARS, moduleInjector) {
|
|
|
3595
3594
|
const canActivateObservables = canActivate.map((c) => {
|
|
3596
3595
|
return defer(() => {
|
|
3597
3596
|
const guard = getToken(c, futureARS, moduleInjector);
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
}
|
|
3602
|
-
else if (isFunction(guard)) {
|
|
3603
|
-
observable = wrapIntoObservable(guard(futureARS, futureRSS));
|
|
3604
|
-
}
|
|
3605
|
-
else {
|
|
3606
|
-
throw new Error('Invalid CanActivate guard');
|
|
3607
|
-
}
|
|
3608
|
-
return observable.pipe(first());
|
|
3597
|
+
const guardVal = isCanActivate(guard) ? guard.canActivate(futureARS, futureRSS) :
|
|
3598
|
+
guard(futureARS, futureRSS);
|
|
3599
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3609
3600
|
});
|
|
3610
3601
|
});
|
|
3611
3602
|
return of(canActivateObservables).pipe(prioritizedGuardValue());
|
|
@@ -3620,17 +3611,9 @@ function runCanActivateChild(futureRSS, path, moduleInjector) {
|
|
|
3620
3611
|
return defer(() => {
|
|
3621
3612
|
const guardsMapped = d.guards.map((c) => {
|
|
3622
3613
|
const guard = getToken(c, d.node, moduleInjector);
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
}
|
|
3627
|
-
else if (isFunction(guard)) {
|
|
3628
|
-
observable = wrapIntoObservable(guard(futureARS, futureRSS));
|
|
3629
|
-
}
|
|
3630
|
-
else {
|
|
3631
|
-
throw new Error('Invalid CanActivateChild guard');
|
|
3632
|
-
}
|
|
3633
|
-
return observable.pipe(first());
|
|
3614
|
+
const guardVal = isCanActivateChild(guard) ? guard.canActivateChild(futureARS, futureRSS) :
|
|
3615
|
+
guard(futureARS, futureRSS);
|
|
3616
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3634
3617
|
});
|
|
3635
3618
|
return of(guardsMapped).pipe(prioritizedGuardValue());
|
|
3636
3619
|
});
|
|
@@ -3643,17 +3626,10 @@ function runCanDeactivate(component, currARS, currRSS, futureRSS, moduleInjector
|
|
|
3643
3626
|
return of(true);
|
|
3644
3627
|
const canDeactivateObservables = canDeactivate.map((c) => {
|
|
3645
3628
|
const guard = getToken(c, currARS, moduleInjector);
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
else if (isFunction(guard)) {
|
|
3651
|
-
observable = wrapIntoObservable(guard(component, currARS, currRSS, futureRSS));
|
|
3652
|
-
}
|
|
3653
|
-
else {
|
|
3654
|
-
throw new Error('Invalid CanDeactivate guard');
|
|
3655
|
-
}
|
|
3656
|
-
return observable.pipe(first());
|
|
3629
|
+
const guardVal = isCanDeactivate(guard) ?
|
|
3630
|
+
guard.canDeactivate(component, currARS, currRSS, futureRSS) :
|
|
3631
|
+
guard(component, currARS, currRSS, futureRSS);
|
|
3632
|
+
return wrapIntoObservable(guardVal).pipe(first());
|
|
3657
3633
|
});
|
|
3658
3634
|
return of(canDeactivateObservables).pipe(prioritizedGuardValue());
|
|
3659
3635
|
}
|
|
@@ -3895,7 +3871,7 @@ function checkOutletNameUniqueness(nodes) {
|
|
|
3895
3871
|
if (routeWithSameOutletName) {
|
|
3896
3872
|
const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
|
|
3897
3873
|
const c = n.value.url.map(s => s.toString()).join('/');
|
|
3898
|
-
throw new
|
|
3874
|
+
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}'.`);
|
|
3899
3875
|
}
|
|
3900
3876
|
names[n.value.outlet] = n.value;
|
|
3901
3877
|
});
|
|
@@ -4204,9 +4180,9 @@ class RouterConfigLoader {
|
|
|
4204
4180
|
}));
|
|
4205
4181
|
}
|
|
4206
4182
|
}
|
|
4207
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
4208
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
4209
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
4183
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4184
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterConfigLoader });
|
|
4185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4210
4186
|
type: Injectable
|
|
4211
4187
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4212
4188
|
|
|
@@ -4294,6 +4270,7 @@ class Router {
|
|
|
4294
4270
|
this.lastSuccessfulNavigation = null;
|
|
4295
4271
|
this.currentNavigation = null;
|
|
4296
4272
|
this.disposed = false;
|
|
4273
|
+
/** @internal */
|
|
4297
4274
|
this.navigationId = 0;
|
|
4298
4275
|
/**
|
|
4299
4276
|
* The id of the currently active page in the router.
|
|
@@ -4555,7 +4532,8 @@ class Router {
|
|
|
4555
4532
|
this.triggerEvent(guardsStart);
|
|
4556
4533
|
}), map(t => (Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) }))), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
|
|
4557
4534
|
if (isUrlTree(t.guardsResult)) {
|
|
4558
|
-
const error = navigationCancelingError(
|
|
4535
|
+
const error = navigationCancelingError(REDIRECTING_CANCELLATION_REASON +
|
|
4536
|
+
`"${this.serializeUrl(t.guardsResult)}"`);
|
|
4559
4537
|
error.url = t.guardsResult;
|
|
4560
4538
|
throw error;
|
|
4561
4539
|
}
|
|
@@ -4592,7 +4570,7 @@ class Router {
|
|
|
4592
4570
|
}));
|
|
4593
4571
|
}
|
|
4594
4572
|
return undefined;
|
|
4595
|
-
}),
|
|
4573
|
+
}),
|
|
4596
4574
|
// --- LOAD COMPONENTS ---
|
|
4597
4575
|
switchTap((t) => {
|
|
4598
4576
|
const loadComponents = (route) => {
|
|
@@ -4612,7 +4590,7 @@ class Router {
|
|
|
4612
4590
|
};
|
|
4613
4591
|
return combineLatest(loadComponents(t.targetSnapshot.root))
|
|
4614
4592
|
.pipe(defaultIfEmpty(), take(1));
|
|
4615
|
-
}), map((t) => {
|
|
4593
|
+
}), switchTap(() => this.afterPreactivation()), map((t) => {
|
|
4616
4594
|
const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4617
4595
|
return (Object.assign(Object.assign({}, t), { targetRouterState }));
|
|
4618
4596
|
}),
|
|
@@ -5170,16 +5148,16 @@ class Router {
|
|
|
5170
5148
|
return { navigationId };
|
|
5171
5149
|
}
|
|
5172
5150
|
}
|
|
5173
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5174
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5151
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5152
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: Router });
|
|
5153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: Router, decorators: [{
|
|
5176
5154
|
type: Injectable
|
|
5177
5155
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5178
5156
|
function validateCommands(commands) {
|
|
5179
5157
|
for (let i = 0; i < commands.length; i++) {
|
|
5180
5158
|
const cmd = commands[i];
|
|
5181
5159
|
if (cmd == null) {
|
|
5182
|
-
throw new
|
|
5160
|
+
throw new ɵRuntimeError(4008 /* RuntimeErrorCode.NULLISH_COMMAND */, NG_DEV_MODE$1 && `The requested path contains ${cmd} segment at index ${i}`);
|
|
5183
5161
|
}
|
|
5184
5162
|
}
|
|
5185
5163
|
}
|
|
@@ -5364,9 +5342,9 @@ class RouterLink {
|
|
|
5364
5342
|
});
|
|
5365
5343
|
}
|
|
5366
5344
|
}
|
|
5367
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5368
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
5369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5345
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5346
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.5", 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 });
|
|
5347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterLink, decorators: [{
|
|
5370
5348
|
type: Directive,
|
|
5371
5349
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5372
5350
|
}], ctorParameters: function () {
|
|
@@ -5485,9 +5463,9 @@ class RouterLinkWithHref {
|
|
|
5485
5463
|
});
|
|
5486
5464
|
}
|
|
5487
5465
|
}
|
|
5488
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5489
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.
|
|
5490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5466
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5467
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.5", 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 });
|
|
5468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5491
5469
|
type: Directive,
|
|
5492
5470
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5493
5471
|
}], 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.5", 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.5", 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.5", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5720
5698
|
type: Directive,
|
|
5721
5699
|
args: [{
|
|
5722
5700
|
selector: '[routerLinkActive]',
|
|
@@ -5822,9 +5800,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5822
5800
|
}
|
|
5823
5801
|
}
|
|
5824
5802
|
}
|
|
5825
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5826
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5827
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5803
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5804
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5828
5806
|
type: Injectable,
|
|
5829
5807
|
args: [{ providedIn: 'root' }]
|
|
5830
5808
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -5861,9 +5839,9 @@ class PreloadAllModules {
|
|
|
5861
5839
|
return fn().pipe(catchError(() => of(null)));
|
|
5862
5840
|
}
|
|
5863
5841
|
}
|
|
5864
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5865
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5866
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5842
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5843
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
5844
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
5867
5845
|
type: Injectable,
|
|
5868
5846
|
args: [{ providedIn: 'root' }]
|
|
5869
5847
|
}] });
|
|
@@ -5881,9 +5859,9 @@ class NoPreloading {
|
|
|
5881
5859
|
return of(null);
|
|
5882
5860
|
}
|
|
5883
5861
|
}
|
|
5884
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5885
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5862
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5863
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
5864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NoPreloading, decorators: [{
|
|
5887
5865
|
type: Injectable,
|
|
5888
5866
|
args: [{ providedIn: 'root' }]
|
|
5889
5867
|
}] });
|
|
@@ -5971,9 +5949,9 @@ class RouterPreloader {
|
|
|
5971
5949
|
});
|
|
5972
5950
|
}
|
|
5973
5951
|
}
|
|
5974
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
5975
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
5976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
5952
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5953
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterPreloader });
|
|
5954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5977
5955
|
type: Injectable
|
|
5978
5956
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
5979
5957
|
|
|
@@ -6053,9 +6031,9 @@ class RouterScroller {
|
|
|
6053
6031
|
}
|
|
6054
6032
|
}
|
|
6055
6033
|
}
|
|
6056
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
6057
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.
|
|
6058
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
6034
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6035
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterScroller });
|
|
6036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6059
6037
|
type: Injectable
|
|
6060
6038
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6061
6039
|
|
|
@@ -6188,10 +6166,10 @@ class RouterModule {
|
|
|
6188
6166
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6189
6167
|
}
|
|
6190
6168
|
}
|
|
6191
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.
|
|
6192
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.
|
|
6193
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.
|
|
6194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.
|
|
6169
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6170
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6171
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterModule });
|
|
6172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RouterModule, decorators: [{
|
|
6195
6173
|
type: NgModule,
|
|
6196
6174
|
args: [{
|
|
6197
6175
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6229,7 +6207,7 @@ function providePathLocationStrategy() {
|
|
|
6229
6207
|
}
|
|
6230
6208
|
function provideForRootGuard(router) {
|
|
6231
6209
|
if (NG_DEV_MODE && router) {
|
|
6232
|
-
throw new
|
|
6210
|
+
throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
|
|
6233
6211
|
}
|
|
6234
6212
|
return 'guarded';
|
|
6235
6213
|
}
|
|
@@ -6356,17 +6334,54 @@ function provideEnabledBlockingInitialNavigation() {
|
|
|
6356
6334
|
useFactory: (injector) => {
|
|
6357
6335
|
const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6358
6336
|
let initNavigation = false;
|
|
6337
|
+
/**
|
|
6338
|
+
* Performs the given action once the router finishes its next/current navigation.
|
|
6339
|
+
*
|
|
6340
|
+
* If the navigation is canceled or errors without a redirect, the navigation is considered
|
|
6341
|
+
* complete. If the `NavigationEnd` event emits, the navigation is also considered complete.
|
|
6342
|
+
*/
|
|
6343
|
+
function afterNextNavigation(action) {
|
|
6344
|
+
const router = injector.get(Router);
|
|
6345
|
+
router.events
|
|
6346
|
+
.pipe(filter((e) => e instanceof NavigationEnd || e instanceof NavigationCancel ||
|
|
6347
|
+
e instanceof NavigationError), map(e => {
|
|
6348
|
+
if (e instanceof NavigationEnd) {
|
|
6349
|
+
// Navigation assumed to succeed if we get `ActivationStart`
|
|
6350
|
+
return true;
|
|
6351
|
+
}
|
|
6352
|
+
const newNavigationStarted = router.navigationId !== e.id;
|
|
6353
|
+
// TODO(atscott): Do not rely on the string reason to determine if cancelation
|
|
6354
|
+
// is redirecting
|
|
6355
|
+
const redirectingWithUrlTree = e instanceof NavigationCancel ?
|
|
6356
|
+
e.reason.indexOf(REDIRECTING_CANCELLATION_REASON) !== -1 :
|
|
6357
|
+
false;
|
|
6358
|
+
// Navigation failed, but if we already have a new navigation, wait for the
|
|
6359
|
+
// result of that one instead.
|
|
6360
|
+
return newNavigationStarted || redirectingWithUrlTree ? null : false;
|
|
6361
|
+
}), filter((result) => result !== null), take(1))
|
|
6362
|
+
.subscribe(() => {
|
|
6363
|
+
action();
|
|
6364
|
+
});
|
|
6365
|
+
}
|
|
6359
6366
|
return () => {
|
|
6360
6367
|
return locationInitialized.then(() => {
|
|
6361
6368
|
return new Promise(resolve => {
|
|
6362
6369
|
const router = injector.get(Router);
|
|
6363
6370
|
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6371
|
+
afterNextNavigation(() => {
|
|
6372
|
+
// Unblock APP_INITIALIZER in case the initial navigation was canceled or errored
|
|
6373
|
+
// without a redirect.
|
|
6374
|
+
resolve(true);
|
|
6375
|
+
initNavigation = true;
|
|
6376
|
+
});
|
|
6364
6377
|
router.afterPreactivation = () => {
|
|
6365
|
-
//
|
|
6378
|
+
// Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we
|
|
6379
|
+
// assume activation will complete successfully (even though this is not
|
|
6380
|
+
// guaranteed).
|
|
6381
|
+
resolve(true);
|
|
6382
|
+
// only the initial navigation should be delayed until bootstrapping is done.
|
|
6366
6383
|
if (!initNavigation) {
|
|
6367
|
-
|
|
6368
|
-
resolve(true);
|
|
6369
|
-
return bootstrapDone;
|
|
6384
|
+
return bootstrapDone.closed ? of(void 0) : bootstrapDone;
|
|
6370
6385
|
// subsequent navigations should not be delayed
|
|
6371
6386
|
}
|
|
6372
6387
|
else {
|
|
@@ -6438,7 +6453,7 @@ function providePreloading(preloadingStrategy) {
|
|
|
6438
6453
|
/**
|
|
6439
6454
|
* @publicApi
|
|
6440
6455
|
*/
|
|
6441
|
-
const VERSION = new Version('14.0.
|
|
6456
|
+
const VERSION = new Version('14.0.5');
|
|
6442
6457
|
|
|
6443
6458
|
/**
|
|
6444
6459
|
* @license
|