@angular/router 14.1.0-next.4 → 14.1.0-rc.0
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 +6 -5
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/directives/router_link.mjs +6 -6
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +4 -4
- package/esm2020/src/events.mjs +10 -2
- package/esm2020/src/index.mjs +1 -1
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/navigation_canceling_error.mjs +32 -0
- package/esm2020/src/operators/check_guards.mjs +5 -6
- package/esm2020/src/operators/prioritized_guard_value.mjs +22 -27
- package/esm2020/src/page_title_strategy.mjs +3 -3
- package/esm2020/src/router.mjs +13 -18
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +4 -4
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/shared.mjs +1 -11
- package/esm2020/src/url_tree.mjs +4 -1
- package/esm2020/src/utils/type_guards.mjs +9 -5
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +4 -4
- package/fesm2015/router.mjs +124 -99
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +123 -99
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +17 -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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0-
|
|
2
|
+
* @license Angular v14.1.0-rc.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
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, concat, defer, pipe, throwError, EmptyError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
|
-
import { map, switchMap, take, startWith,
|
|
10
|
+
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, last as last$1, takeWhile, defaultIfEmpty, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
11
11
|
import * as i3 from '@angular/common';
|
|
12
12
|
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, ViewportScroller, LOCATION_INITIALIZED } from '@angular/common';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
@@ -60,16 +60,6 @@ class ParamsAsMap {
|
|
|
60
60
|
function convertToParamMap(params) {
|
|
61
61
|
return new ParamsAsMap(params);
|
|
62
62
|
}
|
|
63
|
-
const REDIRECTING_CANCELLATION_REASON = 'Redirecting to ';
|
|
64
|
-
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
|
|
65
|
-
function navigationCancelingError(message) {
|
|
66
|
-
const error = Error('NavigationCancelingError: ' + (message || ''));
|
|
67
|
-
error[NAVIGATION_CANCELING_ERROR] = true;
|
|
68
|
-
return error;
|
|
69
|
-
}
|
|
70
|
-
function isNavigationCancelingError(error) {
|
|
71
|
-
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
72
|
-
}
|
|
73
63
|
// Matches the route configuration (`route`) against the actual URL (`segments`).
|
|
74
64
|
function defaultUrlMatcher(segments, segmentGroup, route) {
|
|
75
65
|
const parts = route.path.split('/');
|
|
@@ -799,6 +789,9 @@ function mergeTrivialChildren(s) {
|
|
|
799
789
|
}
|
|
800
790
|
return s;
|
|
801
791
|
}
|
|
792
|
+
function isUrlTree(v) {
|
|
793
|
+
return v instanceof UrlTree;
|
|
794
|
+
}
|
|
802
795
|
|
|
803
796
|
/**
|
|
804
797
|
* @license
|
|
@@ -1380,9 +1373,17 @@ class NavigationError extends RouterEvent {
|
|
|
1380
1373
|
/** @docsNotRequired */
|
|
1381
1374
|
url,
|
|
1382
1375
|
/** @docsNotRequired */
|
|
1383
|
-
error
|
|
1376
|
+
error,
|
|
1377
|
+
/**
|
|
1378
|
+
* The target of the navigation when the error occurred.
|
|
1379
|
+
*
|
|
1380
|
+
* Note that this can be `undefined` because an error could have occurred before the
|
|
1381
|
+
* `RouterStateSnapshot` was created for the navigation.
|
|
1382
|
+
*/
|
|
1383
|
+
target) {
|
|
1384
1384
|
super(id, url);
|
|
1385
1385
|
this.error = error;
|
|
1386
|
+
this.target = target;
|
|
1386
1387
|
this.type = 3 /* EventType.NavigationError */;
|
|
1387
1388
|
}
|
|
1388
1389
|
/** @docsNotRequired */
|
|
@@ -2246,6 +2247,37 @@ function createActivatedRoute(c) {
|
|
|
2246
2247
|
return new ActivatedRoute(new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams), new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);
|
|
2247
2248
|
}
|
|
2248
2249
|
|
|
2250
|
+
/**
|
|
2251
|
+
* @license
|
|
2252
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2253
|
+
*
|
|
2254
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2255
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2256
|
+
*/
|
|
2257
|
+
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
|
|
2258
|
+
function redirectingNavigationError(urlSerializer, redirect) {
|
|
2259
|
+
const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect) ? { redirectTo: redirect, navigationBehaviorOptions: undefined } : redirect;
|
|
2260
|
+
const error = navigationCancelingError(ngDevMode && `Redirecting to "${urlSerializer.serialize(redirectTo)}"`, 0 /* NavigationCancellationCode.Redirect */, redirect);
|
|
2261
|
+
error.url = redirectTo;
|
|
2262
|
+
error.navigationBehaviorOptions = navigationBehaviorOptions;
|
|
2263
|
+
return error;
|
|
2264
|
+
}
|
|
2265
|
+
function navigationCancelingError(message, code, redirectUrl) {
|
|
2266
|
+
const error = new Error('NavigationCancelingError: ' + (message || ''));
|
|
2267
|
+
error[NAVIGATION_CANCELING_ERROR] = true;
|
|
2268
|
+
error.cancellationCode = code;
|
|
2269
|
+
if (redirectUrl) {
|
|
2270
|
+
error.url = redirectUrl;
|
|
2271
|
+
}
|
|
2272
|
+
return error;
|
|
2273
|
+
}
|
|
2274
|
+
function isRedirectingNavigationCancelingError$1(error) {
|
|
2275
|
+
return isNavigationCancelingError$1(error) && isUrlTree(error.url);
|
|
2276
|
+
}
|
|
2277
|
+
function isNavigationCancelingError$1(error) {
|
|
2278
|
+
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2249
2281
|
/**
|
|
2250
2282
|
* @license
|
|
2251
2283
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2511,9 +2543,9 @@ class RouterOutlet {
|
|
|
2511
2543
|
this.activateEvents.emit(this.activated.instance);
|
|
2512
2544
|
}
|
|
2513
2545
|
}
|
|
2514
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
2515
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
2516
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
2546
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2547
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-rc.0", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2517
2549
|
type: Directive,
|
|
2518
2550
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2519
2551
|
}], ctorParameters: function () {
|
|
@@ -2572,9 +2604,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2572
2604
|
*/
|
|
2573
2605
|
class ɵEmptyOutletComponent {
|
|
2574
2606
|
}
|
|
2575
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
2576
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-
|
|
2577
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
2607
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2608
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-rc.0", 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"] }] });
|
|
2609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2578
2610
|
type: Component,
|
|
2579
2611
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2580
2612
|
}] });
|
|
@@ -3113,9 +3145,6 @@ function isFunction(v) {
|
|
|
3113
3145
|
function isBoolean(v) {
|
|
3114
3146
|
return typeof v === 'boolean';
|
|
3115
3147
|
}
|
|
3116
|
-
function isUrlTree(v) {
|
|
3117
|
-
return v instanceof UrlTree;
|
|
3118
|
-
}
|
|
3119
3148
|
function isCanLoad(guard) {
|
|
3120
3149
|
return guard && isFunction(guard.canLoad);
|
|
3121
3150
|
}
|
|
@@ -3131,6 +3160,12 @@ function isCanDeactivate(guard) {
|
|
|
3131
3160
|
function isCanMatch(guard) {
|
|
3132
3161
|
return guard && isFunction(guard.canMatch);
|
|
3133
3162
|
}
|
|
3163
|
+
function isRedirectingNavigationCancelingError(error) {
|
|
3164
|
+
return isNavigationCancelingError(error) && isUrlTree(error.url);
|
|
3165
|
+
}
|
|
3166
|
+
function isNavigationCancelingError(error) {
|
|
3167
|
+
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
3168
|
+
}
|
|
3134
3169
|
|
|
3135
3170
|
/**
|
|
3136
3171
|
* @license
|
|
@@ -3143,31 +3178,26 @@ const INITIAL_VALUE = Symbol('INITIAL_VALUE');
|
|
|
3143
3178
|
function prioritizedGuardValue() {
|
|
3144
3179
|
return switchMap(obs => {
|
|
3145
3180
|
return combineLatest(obs.map(o => o.pipe(take(1), startWith(INITIAL_VALUE))))
|
|
3146
|
-
.pipe(
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
// Toggle pending flag if any values haven't been set yet
|
|
3152
|
-
if (val === INITIAL_VALUE)
|
|
3153
|
-
isPending = true;
|
|
3154
|
-
// Any other return values are only valid if we haven't yet hit a pending
|
|
3155
|
-
// call. This guarantees that in the case of a guard at the bottom of the
|
|
3156
|
-
// tree that returns a redirect, we will wait for the higher priority
|
|
3157
|
-
// guard at the top to finish before performing the redirect.
|
|
3158
|
-
if (!isPending) {
|
|
3159
|
-
// Early return when we hit a `false` value as that should always
|
|
3160
|
-
// cancel navigation
|
|
3161
|
-
if (val === false)
|
|
3162
|
-
return val;
|
|
3163
|
-
if (i === list.length - 1 || isUrlTree(val)) {
|
|
3164
|
-
return val;
|
|
3165
|
-
}
|
|
3181
|
+
.pipe(map((results) => {
|
|
3182
|
+
for (const result of results) {
|
|
3183
|
+
if (result === true) {
|
|
3184
|
+
// If result is true, check the next one
|
|
3185
|
+
continue;
|
|
3166
3186
|
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3187
|
+
else if (result === INITIAL_VALUE) {
|
|
3188
|
+
// If guard has not finished, we need to stop processing.
|
|
3189
|
+
return INITIAL_VALUE;
|
|
3190
|
+
}
|
|
3191
|
+
else if (result === false || result instanceof UrlTree) {
|
|
3192
|
+
// Result finished and was not true. Return the result.
|
|
3193
|
+
// Note that we only allow false/UrlTree. Other values are considered invalid and
|
|
3194
|
+
// ignored.
|
|
3195
|
+
return result;
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
// Everything resolved to true. Return true.
|
|
3199
|
+
return true;
|
|
3200
|
+
}), filter((item) => item !== INITIAL_VALUE), take(1));
|
|
3171
3201
|
});
|
|
3172
3202
|
}
|
|
3173
3203
|
|
|
@@ -3295,9 +3325,7 @@ function redirectIfUrlTree(urlSerializer) {
|
|
|
3295
3325
|
return pipe(tap((result) => {
|
|
3296
3326
|
if (!isUrlTree(result))
|
|
3297
3327
|
return;
|
|
3298
|
-
|
|
3299
|
-
error.url = result;
|
|
3300
|
-
throw error;
|
|
3328
|
+
throw redirectingNavigationError(urlSerializer, result);
|
|
3301
3329
|
}), map(result => result === true));
|
|
3302
3330
|
}
|
|
3303
3331
|
function runCanMatchGuards(injector, route, segments, urlSerializer) {
|
|
@@ -3498,7 +3526,7 @@ function namedOutletsRedirect(redirectTo) {
|
|
|
3498
3526
|
}
|
|
3499
3527
|
function canLoadFails(route) {
|
|
3500
3528
|
return throwError(navigationCancelingError(NG_DEV_MODE$4 &&
|
|
3501
|
-
`Cannot load children because the guard of the route "path: '${route.path}'" returned false
|
|
3529
|
+
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`, 3 /* NavigationCancellationCode.GuardRejected */));
|
|
3502
3530
|
}
|
|
3503
3531
|
/**
|
|
3504
3532
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -3739,9 +3767,9 @@ class ApplyRedirects {
|
|
|
3739
3767
|
}
|
|
3740
3768
|
}
|
|
3741
3769
|
applyRedirectCommands(segments, redirectTo, posParams) {
|
|
3742
|
-
return this.
|
|
3770
|
+
return this.applyRedirectCreateUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
|
|
3743
3771
|
}
|
|
3744
|
-
|
|
3772
|
+
applyRedirectCreateUrlTree(redirectTo, urlTree, segments, posParams) {
|
|
3745
3773
|
const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
|
|
3746
3774
|
return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);
|
|
3747
3775
|
}
|
|
@@ -4374,9 +4402,9 @@ class RouterConfigLoader {
|
|
|
4374
4402
|
}));
|
|
4375
4403
|
}
|
|
4376
4404
|
}
|
|
4377
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
4378
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
4379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
4405
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4406
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterConfigLoader });
|
|
4407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4380
4408
|
type: Injectable
|
|
4381
4409
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4382
4410
|
|
|
@@ -4725,10 +4753,7 @@ class Router {
|
|
|
4725
4753
|
this.triggerEvent(guardsStart);
|
|
4726
4754
|
}), 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 => {
|
|
4727
4755
|
if (isUrlTree(t.guardsResult)) {
|
|
4728
|
-
|
|
4729
|
-
`"${this.serializeUrl(t.guardsResult)}"`);
|
|
4730
|
-
error.url = t.guardsResult;
|
|
4731
|
-
throw error;
|
|
4756
|
+
throw redirectingNavigationError(this.urlSerializer, t.guardsResult);
|
|
4732
4757
|
}
|
|
4733
4758
|
const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);
|
|
4734
4759
|
this.triggerEvent(guardsEnd);
|
|
@@ -4789,7 +4814,7 @@ class Router {
|
|
|
4789
4814
|
const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4790
4815
|
return (Object.assign(Object.assign({}, t), { targetRouterState }));
|
|
4791
4816
|
}),
|
|
4792
|
-
/* Once here, we are about to activate
|
|
4817
|
+
/* Once here, we are about to activate synchronously. The assumption is this
|
|
4793
4818
|
will succeed, and user code may read from the Router service. Therefore
|
|
4794
4819
|
before activation, we need to update router properties storing the current
|
|
4795
4820
|
URL and the RouterState, as well as updated the browser URL. All this should
|
|
@@ -4833,6 +4858,7 @@ class Router {
|
|
|
4833
4858
|
this.currentNavigation = null;
|
|
4834
4859
|
}
|
|
4835
4860
|
}), catchError((e) => {
|
|
4861
|
+
var _a;
|
|
4836
4862
|
// TODO(atscott): The NavigationTransition `t` used here does not accurately
|
|
4837
4863
|
// reflect the current state of the whole transition because some operations
|
|
4838
4864
|
// return a new object rather than modifying the one in the outermost
|
|
@@ -4847,9 +4873,8 @@ class Router {
|
|
|
4847
4873
|
errored = true;
|
|
4848
4874
|
/* This error type is issued during Redirect, and is handled as a
|
|
4849
4875
|
* cancellation rather than an error. */
|
|
4850
|
-
if (isNavigationCancelingError(e)) {
|
|
4851
|
-
|
|
4852
|
-
if (!redirecting) {
|
|
4876
|
+
if (isNavigationCancelingError$1(e)) {
|
|
4877
|
+
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4853
4878
|
// Set property only if we're not redirecting. If we landed on a page and
|
|
4854
4879
|
// redirect to `/` route, the new navigation is going to see the `/`
|
|
4855
4880
|
// isn't a change from the default currentUrlTree and won't navigate.
|
|
@@ -4858,11 +4883,11 @@ class Router {
|
|
|
4858
4883
|
this.navigated = true;
|
|
4859
4884
|
this.restoreHistory(t, true);
|
|
4860
4885
|
}
|
|
4861
|
-
const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message,
|
|
4886
|
+
const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message, e.cancellationCode);
|
|
4862
4887
|
eventsSubject.next(navCancel);
|
|
4863
4888
|
// When redirecting, we need to delay resolving the navigation
|
|
4864
4889
|
// promise and push it to the redirect navigation
|
|
4865
|
-
if (!
|
|
4890
|
+
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4866
4891
|
t.resolve(false);
|
|
4867
4892
|
}
|
|
4868
4893
|
else {
|
|
@@ -4883,7 +4908,7 @@ class Router {
|
|
|
4883
4908
|
}
|
|
4884
4909
|
else {
|
|
4885
4910
|
this.restoreHistory(t, true);
|
|
4886
|
-
const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
|
|
4911
|
+
const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e, (_a = t.targetSnapshot) !== null && _a !== void 0 ? _a : undefined);
|
|
4887
4912
|
eventsSubject.next(navError);
|
|
4888
4913
|
try {
|
|
4889
4914
|
t.resolve(this.errorHandler(e));
|
|
@@ -5287,7 +5312,7 @@ class Router {
|
|
|
5287
5312
|
// The navigator change the location before triggered the browser event,
|
|
5288
5313
|
// so we need to go back to the current url if the navigation is canceled.
|
|
5289
5314
|
// Also, when navigation gets cancelled while using url update strategy eager, then we need to
|
|
5290
|
-
// go back. Because, when `
|
|
5315
|
+
// go back. Because, when `urlUpdateStrategy` is `eager`; `setBrowserUrl` method is called
|
|
5291
5316
|
// before any verification.
|
|
5292
5317
|
const browserUrlUpdateOccurred = (t.source === 'popstate' || this.urlUpdateStrategy === 'eager' ||
|
|
5293
5318
|
this.currentUrlTree === ((_a = this.currentNavigation) === null || _a === void 0 ? void 0 : _a.finalUrl));
|
|
@@ -5345,9 +5370,9 @@ class Router {
|
|
|
5345
5370
|
return { navigationId };
|
|
5346
5371
|
}
|
|
5347
5372
|
}
|
|
5348
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5349
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
5350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5373
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5374
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router });
|
|
5375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router, decorators: [{
|
|
5351
5376
|
type: Injectable
|
|
5352
5377
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5353
5378
|
function validateCommands(commands) {
|
|
@@ -5539,9 +5564,9 @@ class RouterLink {
|
|
|
5539
5564
|
});
|
|
5540
5565
|
}
|
|
5541
5566
|
}
|
|
5542
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5543
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
5544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5567
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5568
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-rc.0", 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 });
|
|
5569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLink, decorators: [{
|
|
5545
5570
|
type: Directive,
|
|
5546
5571
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5547
5572
|
}], ctorParameters: function () {
|
|
@@ -5660,9 +5685,9 @@ class RouterLinkWithHref {
|
|
|
5660
5685
|
});
|
|
5661
5686
|
}
|
|
5662
5687
|
}
|
|
5663
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5664
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
5665
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5688
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5689
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-rc.0", 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 });
|
|
5690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5666
5691
|
type: Directive,
|
|
5667
5692
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5668
5693
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5889,9 +5914,9 @@ class RouterLinkActive {
|
|
|
5889
5914
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5890
5915
|
}
|
|
5891
5916
|
}
|
|
5892
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5893
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
5894
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5917
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", 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 });
|
|
5918
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-rc.0", 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 });
|
|
5919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5895
5920
|
type: Directive,
|
|
5896
5921
|
args: [{
|
|
5897
5922
|
selector: '[routerLinkActive]',
|
|
@@ -5997,9 +6022,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5997
6022
|
}
|
|
5998
6023
|
}
|
|
5999
6024
|
}
|
|
6000
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6001
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6025
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6026
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
6027
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
6003
6028
|
type: Injectable,
|
|
6004
6029
|
args: [{ providedIn: 'root' }]
|
|
6005
6030
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -6036,9 +6061,9 @@ class PreloadAllModules {
|
|
|
6036
6061
|
return fn().pipe(catchError(() => of(null)));
|
|
6037
6062
|
}
|
|
6038
6063
|
}
|
|
6039
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6040
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6041
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6064
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6065
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6042
6067
|
type: Injectable,
|
|
6043
6068
|
args: [{ providedIn: 'root' }]
|
|
6044
6069
|
}] });
|
|
@@ -6056,9 +6081,9 @@ class NoPreloading {
|
|
|
6056
6081
|
return of(null);
|
|
6057
6082
|
}
|
|
6058
6083
|
}
|
|
6059
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6060
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6084
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6085
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6062
6087
|
type: Injectable,
|
|
6063
6088
|
args: [{ providedIn: 'root' }]
|
|
6064
6089
|
}] });
|
|
@@ -6146,9 +6171,9 @@ class RouterPreloader {
|
|
|
6146
6171
|
});
|
|
6147
6172
|
}
|
|
6148
6173
|
}
|
|
6149
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6150
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6174
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6175
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterPreloader });
|
|
6176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6152
6177
|
type: Injectable
|
|
6153
6178
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6154
6179
|
|
|
@@ -6228,9 +6253,9 @@ class RouterScroller {
|
|
|
6228
6253
|
}
|
|
6229
6254
|
}
|
|
6230
6255
|
}
|
|
6231
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6232
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6256
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6257
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller });
|
|
6258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6234
6259
|
type: Injectable
|
|
6235
6260
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6236
6261
|
|
|
@@ -6363,10 +6388,10 @@ class RouterModule {
|
|
|
6363
6388
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6364
6389
|
}
|
|
6365
6390
|
}
|
|
6366
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6367
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-
|
|
6368
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-
|
|
6369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6391
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6392
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6393
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule });
|
|
6394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule, decorators: [{
|
|
6370
6395
|
type: NgModule,
|
|
6371
6396
|
args: [{
|
|
6372
6397
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6646,7 +6671,7 @@ function providePreloading(preloadingStrategy) {
|
|
|
6646
6671
|
/**
|
|
6647
6672
|
* @publicApi
|
|
6648
6673
|
*/
|
|
6649
|
-
const VERSION = new Version('14.1.0-
|
|
6674
|
+
const VERSION = new Version('14.1.0-rc.0');
|
|
6650
6675
|
|
|
6651
6676
|
/**
|
|
6652
6677
|
* @license
|