@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/testing.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
|
*/
|
|
@@ -101,9 +101,9 @@ class RouterTestingModule {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
105
|
-
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-
|
|
106
|
-
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-
|
|
104
|
+
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
105
|
+
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
|
|
106
|
+
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterTestingModule, providers: [
|
|
107
107
|
ɵROUTER_PROVIDERS,
|
|
108
108
|
EXTRA_ROUTER_TESTING_PROVIDERS,
|
|
109
109
|
{ provide: Location, useClass: SpyLocation },
|
|
@@ -128,7 +128,7 @@ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
|
128
128
|
ɵprovidePreloading(NoPreloading),
|
|
129
129
|
provideRoutes([]),
|
|
130
130
|
], imports: [RouterModule] });
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterTestingModule, decorators: [{
|
|
132
132
|
type: NgModule,
|
|
133
133
|
args: [{
|
|
134
134
|
exports: [RouterModule],
|
package/fesm2015/upgrade.mjs
CHANGED
package/fesm2020/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
|
*/
|
|
@@ -9,7 +9,7 @@ import { ɵisObservable, ɵisPromise, ɵRuntimeError, EventEmitter, Directive, A
|
|
|
9
9
|
import { from, of, BehaviorSubject, combineLatest, concat, defer, pipe, throwError, EmptyError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
11
11
|
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, ViewportScroller, LOCATION_INITIALIZED } from '@angular/common';
|
|
12
|
-
import { map, switchMap, take, startWith,
|
|
12
|
+
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, last as last$1, takeWhile, defaultIfEmpty, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -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
|
|
@@ -1378,9 +1371,17 @@ class NavigationError extends RouterEvent {
|
|
|
1378
1371
|
/** @docsNotRequired */
|
|
1379
1372
|
url,
|
|
1380
1373
|
/** @docsNotRequired */
|
|
1381
|
-
error
|
|
1374
|
+
error,
|
|
1375
|
+
/**
|
|
1376
|
+
* The target of the navigation when the error occurred.
|
|
1377
|
+
*
|
|
1378
|
+
* Note that this can be `undefined` because an error could have occurred before the
|
|
1379
|
+
* `RouterStateSnapshot` was created for the navigation.
|
|
1380
|
+
*/
|
|
1381
|
+
target) {
|
|
1382
1382
|
super(id, url);
|
|
1383
1383
|
this.error = error;
|
|
1384
|
+
this.target = target;
|
|
1384
1385
|
this.type = 3 /* EventType.NavigationError */;
|
|
1385
1386
|
}
|
|
1386
1387
|
/** @docsNotRequired */
|
|
@@ -2242,6 +2243,37 @@ function createActivatedRoute(c) {
|
|
|
2242
2243
|
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);
|
|
2243
2244
|
}
|
|
2244
2245
|
|
|
2246
|
+
/**
|
|
2247
|
+
* @license
|
|
2248
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2249
|
+
*
|
|
2250
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2251
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2252
|
+
*/
|
|
2253
|
+
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
|
|
2254
|
+
function redirectingNavigationError(urlSerializer, redirect) {
|
|
2255
|
+
const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect) ? { redirectTo: redirect, navigationBehaviorOptions: undefined } : redirect;
|
|
2256
|
+
const error = navigationCancelingError(ngDevMode && `Redirecting to "${urlSerializer.serialize(redirectTo)}"`, 0 /* NavigationCancellationCode.Redirect */, redirect);
|
|
2257
|
+
error.url = redirectTo;
|
|
2258
|
+
error.navigationBehaviorOptions = navigationBehaviorOptions;
|
|
2259
|
+
return error;
|
|
2260
|
+
}
|
|
2261
|
+
function navigationCancelingError(message, code, redirectUrl) {
|
|
2262
|
+
const error = new Error('NavigationCancelingError: ' + (message || ''));
|
|
2263
|
+
error[NAVIGATION_CANCELING_ERROR] = true;
|
|
2264
|
+
error.cancellationCode = code;
|
|
2265
|
+
if (redirectUrl) {
|
|
2266
|
+
error.url = redirectUrl;
|
|
2267
|
+
}
|
|
2268
|
+
return error;
|
|
2269
|
+
}
|
|
2270
|
+
function isRedirectingNavigationCancelingError$1(error) {
|
|
2271
|
+
return isNavigationCancelingError$1(error) && isUrlTree(error.url);
|
|
2272
|
+
}
|
|
2273
|
+
function isNavigationCancelingError$1(error) {
|
|
2274
|
+
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2245
2277
|
/**
|
|
2246
2278
|
* @license
|
|
2247
2279
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2506,9 +2538,9 @@ class RouterOutlet {
|
|
|
2506
2538
|
this.activateEvents.emit(this.activated.instance);
|
|
2507
2539
|
}
|
|
2508
2540
|
}
|
|
2509
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
2510
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
2511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
2541
|
+
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 });
|
|
2542
|
+
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 });
|
|
2543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2512
2544
|
type: Directive,
|
|
2513
2545
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2514
2546
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
@@ -2565,9 +2597,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2565
2597
|
*/
|
|
2566
2598
|
class ɵEmptyOutletComponent {
|
|
2567
2599
|
}
|
|
2568
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
2569
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-
|
|
2570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
2600
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2601
|
+
ɵ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"] }] });
|
|
2602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2571
2603
|
type: Component,
|
|
2572
2604
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2573
2605
|
}] });
|
|
@@ -3103,9 +3135,6 @@ function isFunction(v) {
|
|
|
3103
3135
|
function isBoolean(v) {
|
|
3104
3136
|
return typeof v === 'boolean';
|
|
3105
3137
|
}
|
|
3106
|
-
function isUrlTree(v) {
|
|
3107
|
-
return v instanceof UrlTree;
|
|
3108
|
-
}
|
|
3109
3138
|
function isCanLoad(guard) {
|
|
3110
3139
|
return guard && isFunction(guard.canLoad);
|
|
3111
3140
|
}
|
|
@@ -3121,6 +3150,12 @@ function isCanDeactivate(guard) {
|
|
|
3121
3150
|
function isCanMatch(guard) {
|
|
3122
3151
|
return guard && isFunction(guard.canMatch);
|
|
3123
3152
|
}
|
|
3153
|
+
function isRedirectingNavigationCancelingError(error) {
|
|
3154
|
+
return isNavigationCancelingError(error) && isUrlTree(error.url);
|
|
3155
|
+
}
|
|
3156
|
+
function isNavigationCancelingError(error) {
|
|
3157
|
+
return error && error[NAVIGATION_CANCELING_ERROR];
|
|
3158
|
+
}
|
|
3124
3159
|
|
|
3125
3160
|
/**
|
|
3126
3161
|
* @license
|
|
@@ -3133,31 +3168,26 @@ const INITIAL_VALUE = Symbol('INITIAL_VALUE');
|
|
|
3133
3168
|
function prioritizedGuardValue() {
|
|
3134
3169
|
return switchMap(obs => {
|
|
3135
3170
|
return combineLatest(obs.map(o => o.pipe(take(1), startWith(INITIAL_VALUE))))
|
|
3136
|
-
.pipe(
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
if (
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
//
|
|
3150
|
-
|
|
3151
|
-
if (val === false)
|
|
3152
|
-
return val;
|
|
3153
|
-
if (i === list.length - 1 || isUrlTree(val)) {
|
|
3154
|
-
return val;
|
|
3155
|
-
}
|
|
3171
|
+
.pipe(map((results) => {
|
|
3172
|
+
for (const result of results) {
|
|
3173
|
+
if (result === true) {
|
|
3174
|
+
// If result is true, check the next one
|
|
3175
|
+
continue;
|
|
3176
|
+
}
|
|
3177
|
+
else if (result === INITIAL_VALUE) {
|
|
3178
|
+
// If guard has not finished, we need to stop processing.
|
|
3179
|
+
return INITIAL_VALUE;
|
|
3180
|
+
}
|
|
3181
|
+
else if (result === false || result instanceof UrlTree) {
|
|
3182
|
+
// Result finished and was not true. Return the result.
|
|
3183
|
+
// Note that we only allow false/UrlTree. Other values are considered invalid and
|
|
3184
|
+
// ignored.
|
|
3185
|
+
return result;
|
|
3156
3186
|
}
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
take(1));
|
|
3187
|
+
}
|
|
3188
|
+
// Everything resolved to true. Return true.
|
|
3189
|
+
return true;
|
|
3190
|
+
}), filter((item) => item !== INITIAL_VALUE), take(1));
|
|
3161
3191
|
});
|
|
3162
3192
|
}
|
|
3163
3193
|
|
|
@@ -3285,9 +3315,7 @@ function redirectIfUrlTree(urlSerializer) {
|
|
|
3285
3315
|
return pipe(tap((result) => {
|
|
3286
3316
|
if (!isUrlTree(result))
|
|
3287
3317
|
return;
|
|
3288
|
-
|
|
3289
|
-
error.url = result;
|
|
3290
|
-
throw error;
|
|
3318
|
+
throw redirectingNavigationError(urlSerializer, result);
|
|
3291
3319
|
}), map(result => result === true));
|
|
3292
3320
|
}
|
|
3293
3321
|
function runCanMatchGuards(injector, route, segments, urlSerializer) {
|
|
@@ -3488,7 +3516,7 @@ function namedOutletsRedirect(redirectTo) {
|
|
|
3488
3516
|
}
|
|
3489
3517
|
function canLoadFails(route) {
|
|
3490
3518
|
return throwError(navigationCancelingError(NG_DEV_MODE$4 &&
|
|
3491
|
-
`Cannot load children because the guard of the route "path: '${route.path}'" returned false
|
|
3519
|
+
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`, 3 /* NavigationCancellationCode.GuardRejected */));
|
|
3492
3520
|
}
|
|
3493
3521
|
/**
|
|
3494
3522
|
* Returns the `UrlTree` with the redirection applied.
|
|
@@ -3727,9 +3755,9 @@ class ApplyRedirects {
|
|
|
3727
3755
|
}
|
|
3728
3756
|
}
|
|
3729
3757
|
applyRedirectCommands(segments, redirectTo, posParams) {
|
|
3730
|
-
return this.
|
|
3758
|
+
return this.applyRedirectCreateUrlTree(redirectTo, this.urlSerializer.parse(redirectTo), segments, posParams);
|
|
3731
3759
|
}
|
|
3732
|
-
|
|
3760
|
+
applyRedirectCreateUrlTree(redirectTo, urlTree, segments, posParams) {
|
|
3733
3761
|
const newRoot = this.createSegmentGroup(redirectTo, urlTree.root, segments, posParams);
|
|
3734
3762
|
return new UrlTree(newRoot, this.createQueryParams(urlTree.queryParams, this.urlTree.queryParams), urlTree.fragment);
|
|
3735
3763
|
}
|
|
@@ -4355,9 +4383,9 @@ class RouterConfigLoader {
|
|
|
4355
4383
|
}));
|
|
4356
4384
|
}
|
|
4357
4385
|
}
|
|
4358
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
4359
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
4360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
4386
|
+
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 });
|
|
4387
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterConfigLoader });
|
|
4388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4361
4389
|
type: Injectable
|
|
4362
4390
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4363
4391
|
|
|
@@ -4724,10 +4752,7 @@ class Router {
|
|
|
4724
4752
|
guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts)
|
|
4725
4753
|
})), checkGuards(this.ngModule.injector, (evt) => this.triggerEvent(evt)), tap(t => {
|
|
4726
4754
|
if (isUrlTree(t.guardsResult)) {
|
|
4727
|
-
|
|
4728
|
-
`"${this.serializeUrl(t.guardsResult)}"`);
|
|
4729
|
-
error.url = t.guardsResult;
|
|
4730
|
-
throw error;
|
|
4755
|
+
throw redirectingNavigationError(this.urlSerializer, t.guardsResult);
|
|
4731
4756
|
}
|
|
4732
4757
|
const guardsEnd = new GuardsCheckEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);
|
|
4733
4758
|
this.triggerEvent(guardsEnd);
|
|
@@ -4787,7 +4812,7 @@ class Router {
|
|
|
4787
4812
|
const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4788
4813
|
return ({ ...t, targetRouterState });
|
|
4789
4814
|
}),
|
|
4790
|
-
/* Once here, we are about to activate
|
|
4815
|
+
/* Once here, we are about to activate synchronously. The assumption is this
|
|
4791
4816
|
will succeed, and user code may read from the Router service. Therefore
|
|
4792
4817
|
before activation, we need to update router properties storing the current
|
|
4793
4818
|
URL and the RouterState, as well as updated the browser URL. All this should
|
|
@@ -4844,9 +4869,8 @@ class Router {
|
|
|
4844
4869
|
errored = true;
|
|
4845
4870
|
/* This error type is issued during Redirect, and is handled as a
|
|
4846
4871
|
* cancellation rather than an error. */
|
|
4847
|
-
if (isNavigationCancelingError(e)) {
|
|
4848
|
-
|
|
4849
|
-
if (!redirecting) {
|
|
4872
|
+
if (isNavigationCancelingError$1(e)) {
|
|
4873
|
+
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4850
4874
|
// Set property only if we're not redirecting. If we landed on a page and
|
|
4851
4875
|
// redirect to `/` route, the new navigation is going to see the `/`
|
|
4852
4876
|
// isn't a change from the default currentUrlTree and won't navigate.
|
|
@@ -4855,11 +4879,11 @@ class Router {
|
|
|
4855
4879
|
this.navigated = true;
|
|
4856
4880
|
this.restoreHistory(t, true);
|
|
4857
4881
|
}
|
|
4858
|
-
const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message,
|
|
4882
|
+
const navCancel = new NavigationCancel(t.id, this.serializeUrl(t.extractedUrl), e.message, e.cancellationCode);
|
|
4859
4883
|
eventsSubject.next(navCancel);
|
|
4860
4884
|
// When redirecting, we need to delay resolving the navigation
|
|
4861
4885
|
// promise and push it to the redirect navigation
|
|
4862
|
-
if (!
|
|
4886
|
+
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4863
4887
|
t.resolve(false);
|
|
4864
4888
|
}
|
|
4865
4889
|
else {
|
|
@@ -4880,7 +4904,7 @@ class Router {
|
|
|
4880
4904
|
}
|
|
4881
4905
|
else {
|
|
4882
4906
|
this.restoreHistory(t, true);
|
|
4883
|
-
const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e);
|
|
4907
|
+
const navError = new NavigationError(t.id, this.serializeUrl(t.extractedUrl), e, t.targetSnapshot ?? undefined);
|
|
4884
4908
|
eventsSubject.next(navError);
|
|
4885
4909
|
try {
|
|
4886
4910
|
t.resolve(this.errorHandler(e));
|
|
@@ -5280,7 +5304,7 @@ class Router {
|
|
|
5280
5304
|
// The navigator change the location before triggered the browser event,
|
|
5281
5305
|
// so we need to go back to the current url if the navigation is canceled.
|
|
5282
5306
|
// Also, when navigation gets cancelled while using url update strategy eager, then we need to
|
|
5283
|
-
// go back. Because, when `
|
|
5307
|
+
// go back. Because, when `urlUpdateStrategy` is `eager`; `setBrowserUrl` method is called
|
|
5284
5308
|
// before any verification.
|
|
5285
5309
|
const browserUrlUpdateOccurred = (t.source === 'popstate' || this.urlUpdateStrategy === 'eager' ||
|
|
5286
5310
|
this.currentUrlTree === this.currentNavigation?.finalUrl);
|
|
@@ -5338,9 +5362,9 @@ class Router {
|
|
|
5338
5362
|
return { navigationId };
|
|
5339
5363
|
}
|
|
5340
5364
|
}
|
|
5341
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5342
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
5343
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5365
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5366
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router });
|
|
5367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: Router, decorators: [{
|
|
5344
5368
|
type: Injectable
|
|
5345
5369
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5346
5370
|
function validateCommands(commands) {
|
|
@@ -5539,9 +5563,9 @@ class RouterLink {
|
|
|
5539
5563
|
});
|
|
5540
5564
|
}
|
|
5541
5565
|
}
|
|
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-
|
|
5566
|
+
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 });
|
|
5567
|
+
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 });
|
|
5568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLink, decorators: [{
|
|
5545
5569
|
type: Directive,
|
|
5546
5570
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5547
5571
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5658,9 +5682,9 @@ class RouterLinkWithHref {
|
|
|
5658
5682
|
});
|
|
5659
5683
|
}
|
|
5660
5684
|
}
|
|
5661
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5662
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
5663
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5685
|
+
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 });
|
|
5686
|
+
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 });
|
|
5687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5664
5688
|
type: Directive,
|
|
5665
5689
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5666
5690
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5885,9 +5909,9 @@ class RouterLinkActive {
|
|
|
5885
5909
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5886
5910
|
}
|
|
5887
5911
|
}
|
|
5888
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5889
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-
|
|
5890
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
5912
|
+
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 });
|
|
5913
|
+
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 });
|
|
5914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5891
5915
|
type: Directive,
|
|
5892
5916
|
args: [{
|
|
5893
5917
|
selector: '[routerLinkActive]',
|
|
@@ -5990,9 +6014,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5990
6014
|
}
|
|
5991
6015
|
}
|
|
5992
6016
|
}
|
|
5993
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
5994
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
5995
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6017
|
+
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 });
|
|
6018
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
6019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5996
6020
|
type: Injectable,
|
|
5997
6021
|
args: [{ providedIn: 'root' }]
|
|
5998
6022
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -6029,9 +6053,9 @@ class PreloadAllModules {
|
|
|
6029
6053
|
return fn().pipe(catchError(() => of(null)));
|
|
6030
6054
|
}
|
|
6031
6055
|
}
|
|
6032
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6033
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6034
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6056
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6057
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6058
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6035
6059
|
type: Injectable,
|
|
6036
6060
|
args: [{ providedIn: 'root' }]
|
|
6037
6061
|
}] });
|
|
@@ -6049,9 +6073,9 @@ class NoPreloading {
|
|
|
6049
6073
|
return of(null);
|
|
6050
6074
|
}
|
|
6051
6075
|
}
|
|
6052
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6053
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6076
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6077
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6055
6079
|
type: Injectable,
|
|
6056
6080
|
args: [{ providedIn: 'root' }]
|
|
6057
6081
|
}] });
|
|
@@ -6137,9 +6161,9 @@ class RouterPreloader {
|
|
|
6137
6161
|
});
|
|
6138
6162
|
}
|
|
6139
6163
|
}
|
|
6140
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6141
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6164
|
+
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 });
|
|
6165
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterPreloader });
|
|
6166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6143
6167
|
type: Injectable
|
|
6144
6168
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6145
6169
|
|
|
@@ -6226,9 +6250,9 @@ class RouterScroller {
|
|
|
6226
6250
|
}
|
|
6227
6251
|
}
|
|
6228
6252
|
}
|
|
6229
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6230
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-
|
|
6231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6253
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6254
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller });
|
|
6255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6232
6256
|
type: Injectable
|
|
6233
6257
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6234
6258
|
|
|
@@ -6361,10 +6385,10 @@ class RouterModule {
|
|
|
6361
6385
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6362
6386
|
}
|
|
6363
6387
|
}
|
|
6364
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-
|
|
6365
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-
|
|
6366
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-
|
|
6367
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-
|
|
6388
|
+
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 });
|
|
6389
|
+
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] });
|
|
6390
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule });
|
|
6391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-rc.0", ngImport: i0, type: RouterModule, decorators: [{
|
|
6368
6392
|
type: NgModule,
|
|
6369
6393
|
args: [{
|
|
6370
6394
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6640,7 +6664,7 @@ function providePreloading(preloadingStrategy) {
|
|
|
6640
6664
|
/**
|
|
6641
6665
|
* @publicApi
|
|
6642
6666
|
*/
|
|
6643
|
-
const VERSION = new Version('14.1.0-
|
|
6667
|
+
const VERSION = new Version('14.1.0-rc.0');
|
|
6644
6668
|
|
|
6645
6669
|
/**
|
|
6646
6670
|
* @license
|