@angular/router 17.0.0-next.0 → 17.0.0-next.2
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/esm2022/src/components/empty_outlet.mjs +3 -3
- package/esm2022/src/directives/router_link.mjs +3 -3
- package/esm2022/src/directives/router_link_active.mjs +5 -5
- package/esm2022/src/directives/router_outlet.mjs +6 -6
- package/esm2022/src/events.mjs +8 -1
- package/esm2022/src/navigation_transition.mjs +62 -94
- package/esm2022/src/page_title_strategy.mjs +6 -6
- package/esm2022/src/route_reuse_strategy.mjs +6 -6
- package/esm2022/src/router.mjs +117 -51
- package/esm2022/src/router_config_loader.mjs +3 -3
- package/esm2022/src/router_module.mjs +4 -4
- package/esm2022/src/router_outlet_context.mjs +3 -3
- package/esm2022/src/router_preloader.mjs +9 -9
- package/esm2022/src/router_scroller.mjs +3 -3
- package/esm2022/src/url_handling_strategy.mjs +6 -6
- package/esm2022/src/url_tree.mjs +4 -4
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/router_testing_harness.mjs +6 -6
- package/esm2022/testing/src/router_testing_module.mjs +4 -4
- package/fesm2022/router.mjs +321 -282
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/testing.mjs +11 -11
- package/fesm2022/upgrade.mjs +1 -1
- package/index.d.ts +14 -43
- package/package.json +4 -4
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2022/router.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.0.0-next.
|
|
2
|
+
* @license Angular v17.0.0-next.2
|
|
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
8
|
import { ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, InjectionToken, reflectComponentType, Component, createEnvironmentInjector, ɵisNgModule, isStandalone, ɵisInjectable, Compiler, InjectFlags, NgModuleFactory, ɵConsole, ɵInitialRenderPendingTasks, NgZone, ɵɵsanitizeUrlOrResourceUrl, booleanAttribute, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ENVIRONMENT_INITIALIZER, Injector, ApplicationRef, APP_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
|
|
9
|
-
import { isObservable, from, of, BehaviorSubject, combineLatest, EmptyError, concat, defer, pipe, throwError, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
9
|
+
import { isObservable, from, of, BehaviorSubject, combineLatest, EmptyError, concat, defer, pipe, throwError, EMPTY, ConnectableObservable, Subject, Subscription } from 'rxjs';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
11
11
|
import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
|
|
12
|
-
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, defaultIfEmpty, last as last$1, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
12
|
+
import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, defaultIfEmpty, last as last$1, takeLast, mapTo, finalize, refCount, takeUntil, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -419,10 +419,10 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
419
419
|
* @publicApi
|
|
420
420
|
*/
|
|
421
421
|
class UrlSerializer {
|
|
422
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
423
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
422
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
423
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
|
|
424
424
|
}
|
|
425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
426
426
|
type: Injectable,
|
|
427
427
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
428
428
|
}] });
|
|
@@ -1667,6 +1667,13 @@ class Scroll {
|
|
|
1667
1667
|
return `Scroll(anchor: '${this.anchor}', position: '${pos}')`;
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
|
+
class BeforeActivateRoutes {
|
|
1671
|
+
}
|
|
1672
|
+
class RedirectRequest {
|
|
1673
|
+
constructor(url) {
|
|
1674
|
+
this.url = url;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1670
1677
|
function stringifyEvent(routerEvent) {
|
|
1671
1678
|
switch (routerEvent.type) {
|
|
1672
1679
|
case 14 /* EventType.ActivationEnd */:
|
|
@@ -1772,10 +1779,10 @@ class ChildrenOutletContexts {
|
|
|
1772
1779
|
getContext(childName) {
|
|
1773
1780
|
return this.contexts.get(childName) || null;
|
|
1774
1781
|
}
|
|
1775
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
1776
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
1782
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1783
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
|
|
1777
1784
|
}
|
|
1778
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
1785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
1779
1786
|
type: Injectable,
|
|
1780
1787
|
args: [{ providedIn: 'root' }]
|
|
1781
1788
|
}] });
|
|
@@ -2482,10 +2489,10 @@ class RouterOutlet {
|
|
|
2482
2489
|
this.inputBinder?.bindActivatedRouteToOutletComponent(this);
|
|
2483
2490
|
this.activateEvents.emit(this.activated.instance);
|
|
2484
2491
|
}
|
|
2485
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2486
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0-next.
|
|
2492
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2493
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0-next.2", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
|
|
2487
2494
|
}
|
|
2488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2489
2496
|
type: Directive,
|
|
2490
2497
|
args: [{
|
|
2491
2498
|
selector: 'router-outlet',
|
|
@@ -2588,10 +2595,10 @@ class RoutedComponentInputBinder {
|
|
|
2588
2595
|
});
|
|
2589
2596
|
this.outletDataSubscriptions.set(outlet, dataSubscription);
|
|
2590
2597
|
}
|
|
2591
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2592
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2598
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2599
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder }); }
|
|
2593
2600
|
}
|
|
2594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
|
|
2595
2602
|
type: Injectable
|
|
2596
2603
|
}] });
|
|
2597
2604
|
|
|
@@ -2671,10 +2678,10 @@ function isNavigationCancelingError$1(error) {
|
|
|
2671
2678
|
* to this `EmptyOutletComponent`.
|
|
2672
2679
|
*/
|
|
2673
2680
|
class ɵEmptyOutletComponent {
|
|
2674
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2675
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0-next.
|
|
2681
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2682
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0-next.2", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
|
|
2676
2683
|
}
|
|
2677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
2684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2678
2685
|
type: Component,
|
|
2679
2686
|
args: [{
|
|
2680
2687
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -4049,6 +4056,93 @@ function switchTap(next) {
|
|
|
4049
4056
|
});
|
|
4050
4057
|
}
|
|
4051
4058
|
|
|
4059
|
+
/**
|
|
4060
|
+
* Provides a strategy for setting the page title after a router navigation.
|
|
4061
|
+
*
|
|
4062
|
+
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
4063
|
+
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
4064
|
+
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
4065
|
+
* ```
|
|
4066
|
+
* [
|
|
4067
|
+
* {path: 'base', title: 'base', children: [
|
|
4068
|
+
* {path: 'child', title: 'child'},
|
|
4069
|
+
* ],
|
|
4070
|
+
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
4071
|
+
* ]
|
|
4072
|
+
* ```
|
|
4073
|
+
*
|
|
4074
|
+
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
4075
|
+
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
4076
|
+
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
4077
|
+
* incorporate titles in named outlets.
|
|
4078
|
+
*
|
|
4079
|
+
* @publicApi
|
|
4080
|
+
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
4081
|
+
*/
|
|
4082
|
+
class TitleStrategy {
|
|
4083
|
+
/**
|
|
4084
|
+
* @returns The `title` of the deepest primary route.
|
|
4085
|
+
*/
|
|
4086
|
+
buildTitle(snapshot) {
|
|
4087
|
+
let pageTitle;
|
|
4088
|
+
let route = snapshot.root;
|
|
4089
|
+
while (route !== undefined) {
|
|
4090
|
+
pageTitle = this.getResolvedTitleForRoute(route) ?? pageTitle;
|
|
4091
|
+
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
4092
|
+
}
|
|
4093
|
+
return pageTitle;
|
|
4094
|
+
}
|
|
4095
|
+
/**
|
|
4096
|
+
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
4097
|
+
* `Route.title` property, which can either be a static string or a resolved value.
|
|
4098
|
+
*/
|
|
4099
|
+
getResolvedTitleForRoute(snapshot) {
|
|
4100
|
+
return snapshot.data[RouteTitleKey];
|
|
4101
|
+
}
|
|
4102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4103
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
|
|
4104
|
+
}
|
|
4105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4106
|
+
type: Injectable,
|
|
4107
|
+
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4108
|
+
}] });
|
|
4109
|
+
/**
|
|
4110
|
+
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
4111
|
+
*/
|
|
4112
|
+
class DefaultTitleStrategy extends TitleStrategy {
|
|
4113
|
+
constructor(title) {
|
|
4114
|
+
super();
|
|
4115
|
+
this.title = title;
|
|
4116
|
+
}
|
|
4117
|
+
/**
|
|
4118
|
+
* Sets the title of the browser to the given value.
|
|
4119
|
+
*
|
|
4120
|
+
* @param title The `pageTitle` from the deepest primary route.
|
|
4121
|
+
*/
|
|
4122
|
+
updateTitle(snapshot) {
|
|
4123
|
+
const title = this.buildTitle(snapshot);
|
|
4124
|
+
if (title !== undefined) {
|
|
4125
|
+
this.title.setTitle(title);
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4129
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
|
|
4130
|
+
}
|
|
4131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4132
|
+
type: Injectable,
|
|
4133
|
+
args: [{ providedIn: 'root' }]
|
|
4134
|
+
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
4135
|
+
|
|
4136
|
+
/**
|
|
4137
|
+
* A [DI token](guide/glossary/#di-token) for the router service.
|
|
4138
|
+
*
|
|
4139
|
+
* @publicApi
|
|
4140
|
+
*/
|
|
4141
|
+
const ROUTER_CONFIGURATION = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'router config' : '', {
|
|
4142
|
+
providedIn: 'root',
|
|
4143
|
+
factory: () => ({}),
|
|
4144
|
+
});
|
|
4145
|
+
|
|
4052
4146
|
/**
|
|
4053
4147
|
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4054
4148
|
*
|
|
@@ -4148,10 +4242,10 @@ class RouterConfigLoader {
|
|
|
4148
4242
|
}
|
|
4149
4243
|
}));
|
|
4150
4244
|
}
|
|
4151
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4152
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4245
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4246
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
|
|
4153
4247
|
}
|
|
4154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4155
4249
|
type: Injectable,
|
|
4156
4250
|
args: [{ providedIn: 'root' }]
|
|
4157
4251
|
}] });
|
|
@@ -4173,13 +4267,26 @@ class NavigationTransitions {
|
|
|
4173
4267
|
}
|
|
4174
4268
|
constructor() {
|
|
4175
4269
|
this.currentNavigation = null;
|
|
4270
|
+
this.currentTransition = null;
|
|
4176
4271
|
this.lastSuccessfulNavigation = null;
|
|
4272
|
+
/**
|
|
4273
|
+
* These events are used to communicate back to the Router about the state of the transition. The
|
|
4274
|
+
* Router wants to respond to these events in various ways. Because the `NavigationTransition`
|
|
4275
|
+
* class is not public, this event subject is not publicly exposed.
|
|
4276
|
+
*/
|
|
4177
4277
|
this.events = new Subject();
|
|
4278
|
+
/**
|
|
4279
|
+
* Used to abort the current transition with an error.
|
|
4280
|
+
*/
|
|
4281
|
+
this.transitionAbortSubject = new Subject();
|
|
4178
4282
|
this.configLoader = inject(RouterConfigLoader);
|
|
4179
4283
|
this.environmentInjector = inject(EnvironmentInjector);
|
|
4180
4284
|
this.urlSerializer = inject(UrlSerializer);
|
|
4181
4285
|
this.rootContexts = inject(ChildrenOutletContexts);
|
|
4182
4286
|
this.inputBindingEnabled = inject(INPUT_BINDER, { optional: true }) !== null;
|
|
4287
|
+
this.titleStrategy = inject(TitleStrategy);
|
|
4288
|
+
this.options = inject(ROUTER_CONFIGURATION, { optional: true }) || {};
|
|
4289
|
+
this.paramsInheritanceStrategy = this.options.paramsInheritanceStrategy || 'emptyOnly';
|
|
4183
4290
|
this.navigationId = 0;
|
|
4184
4291
|
/**
|
|
4185
4292
|
* Hook that enables you to pause navigation after the preactivation phase.
|
|
@@ -4202,23 +4309,24 @@ class NavigationTransitions {
|
|
|
4202
4309
|
const id = ++this.navigationId;
|
|
4203
4310
|
this.transitions?.next({ ...this.transitions.value, ...request, id });
|
|
4204
4311
|
}
|
|
4205
|
-
setupNavigations(router) {
|
|
4312
|
+
setupNavigations(router, initialUrlTree, initialRouterState) {
|
|
4206
4313
|
this.transitions = new BehaviorSubject({
|
|
4207
4314
|
id: 0,
|
|
4208
|
-
currentUrlTree:
|
|
4209
|
-
currentRawUrl:
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4315
|
+
currentUrlTree: initialUrlTree,
|
|
4316
|
+
currentRawUrl: initialUrlTree,
|
|
4317
|
+
currentBrowserUrl: initialUrlTree,
|
|
4318
|
+
extractedUrl: router.urlHandlingStrategy.extract(initialUrlTree),
|
|
4319
|
+
urlAfterRedirects: router.urlHandlingStrategy.extract(initialUrlTree),
|
|
4320
|
+
rawUrl: initialUrlTree,
|
|
4213
4321
|
extras: {},
|
|
4214
4322
|
resolve: null,
|
|
4215
4323
|
reject: null,
|
|
4216
4324
|
promise: Promise.resolve(true),
|
|
4217
4325
|
source: IMPERATIVE_NAVIGATION,
|
|
4218
4326
|
restoredState: null,
|
|
4219
|
-
currentSnapshot:
|
|
4327
|
+
currentSnapshot: initialRouterState.snapshot,
|
|
4220
4328
|
targetSnapshot: null,
|
|
4221
|
-
currentRouterState:
|
|
4329
|
+
currentRouterState: initialRouterState,
|
|
4222
4330
|
targetRouterState: null,
|
|
4223
4331
|
guards: { canActivateChecks: [], canDeactivateChecks: [] },
|
|
4224
4332
|
guardsResult: null,
|
|
@@ -4228,6 +4336,7 @@ class NavigationTransitions {
|
|
|
4228
4336
|
map(t => ({ ...t, extractedUrl: router.urlHandlingStrategy.extract(t.rawUrl) })),
|
|
4229
4337
|
// Using switchMap so we cancel executing navigations when a new one comes in
|
|
4230
4338
|
switchMap(overallTransitionState => {
|
|
4339
|
+
this.currentTransition = overallTransitionState;
|
|
4231
4340
|
let completed = false;
|
|
4232
4341
|
let errored = false;
|
|
4233
4342
|
return of(overallTransitionState)
|
|
@@ -4246,30 +4355,24 @@ class NavigationTransitions {
|
|
|
4246
4355
|
},
|
|
4247
4356
|
};
|
|
4248
4357
|
}), switchMap(t => {
|
|
4249
|
-
const browserUrlTree =
|
|
4358
|
+
const browserUrlTree = t.currentBrowserUrl.toString();
|
|
4250
4359
|
const urlTransition = !router.navigated ||
|
|
4251
4360
|
t.extractedUrl.toString() !== browserUrlTree ||
|
|
4252
4361
|
// Navigations which succeed or ones which fail and are cleaned up
|
|
4253
4362
|
// correctly should result in `browserUrlTree` and `currentUrlTree`
|
|
4254
4363
|
// matching. If this is not the case, assume something went wrong and
|
|
4255
4364
|
// try processing the URL again.
|
|
4256
|
-
browserUrlTree !==
|
|
4365
|
+
browserUrlTree !== t.currentUrlTree.toString();
|
|
4257
4366
|
const onSameUrlNavigation = t.extras.onSameUrlNavigation ?? router.onSameUrlNavigation;
|
|
4258
4367
|
if (!urlTransition && onSameUrlNavigation !== 'reload') {
|
|
4259
4368
|
const reason = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4260
4369
|
`Navigation to ${t.rawUrl} was ignored because it is the same as the current Router URL.` :
|
|
4261
4370
|
'';
|
|
4262
|
-
this.events.next(new NavigationSkipped(t.id,
|
|
4263
|
-
router.rawUrlTree = t.rawUrl;
|
|
4371
|
+
this.events.next(new NavigationSkipped(t.id, this.urlSerializer.serialize(t.rawUrl), reason, 0 /* NavigationSkippedCode.IgnoredSameUrlNavigation */));
|
|
4264
4372
|
t.resolve(null);
|
|
4265
4373
|
return EMPTY;
|
|
4266
4374
|
}
|
|
4267
4375
|
if (router.urlHandlingStrategy.shouldProcessUrl(t.rawUrl)) {
|
|
4268
|
-
// If the source of the navigation is from a browser event, the URL is
|
|
4269
|
-
// already updated. We already need to sync the internal state.
|
|
4270
|
-
if (isBrowserTriggeredNavigation(t.source)) {
|
|
4271
|
-
router.browserUrlTree = t.extractedUrl;
|
|
4272
|
-
}
|
|
4273
4376
|
return of(t).pipe(
|
|
4274
4377
|
// Fire NavigationStart event
|
|
4275
4378
|
switchMap(t => {
|
|
@@ -4283,7 +4386,7 @@ class NavigationTransitions {
|
|
|
4283
4386
|
return Promise.resolve(t);
|
|
4284
4387
|
}),
|
|
4285
4388
|
// Recognize
|
|
4286
|
-
recognize(this.environmentInjector, this.configLoader, this.rootComponentType, router.config, this.urlSerializer,
|
|
4389
|
+
recognize(this.environmentInjector, this.configLoader, this.rootComponentType, router.config, this.urlSerializer, this.paramsInheritanceStrategy),
|
|
4287
4390
|
// Update URL if in `eager` update mode
|
|
4288
4391
|
tap(t => {
|
|
4289
4392
|
overallTransitionState.targetSnapshot = t.targetSnapshot;
|
|
@@ -4292,20 +4395,13 @@ class NavigationTransitions {
|
|
|
4292
4395
|
...this.currentNavigation,
|
|
4293
4396
|
finalUrl: t.urlAfterRedirects
|
|
4294
4397
|
};
|
|
4295
|
-
if (router.urlUpdateStrategy === 'eager') {
|
|
4296
|
-
if (!t.extras.skipLocationChange) {
|
|
4297
|
-
const rawUrl = router.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4298
|
-
router.setBrowserUrl(rawUrl, t);
|
|
4299
|
-
}
|
|
4300
|
-
router.browserUrlTree = t.urlAfterRedirects;
|
|
4301
|
-
}
|
|
4302
4398
|
// Fire RoutesRecognized
|
|
4303
4399
|
const routesRecognized = new RoutesRecognized(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4304
4400
|
this.events.next(routesRecognized);
|
|
4305
4401
|
}));
|
|
4306
4402
|
}
|
|
4307
4403
|
else if (urlTransition &&
|
|
4308
|
-
router.urlHandlingStrategy.shouldProcessUrl(
|
|
4404
|
+
router.urlHandlingStrategy.shouldProcessUrl(t.currentRawUrl)) {
|
|
4309
4405
|
/* When the current URL shouldn't be processed, but the previous one
|
|
4310
4406
|
* was, we handle this "error condition" by navigating to the
|
|
4311
4407
|
* previously successful URL, but leaving the URL intact.*/
|
|
@@ -4313,7 +4409,7 @@ class NavigationTransitions {
|
|
|
4313
4409
|
const navStart = new NavigationStart(id, this.urlSerializer.serialize(extractedUrl), source, restoredState);
|
|
4314
4410
|
this.events.next(navStart);
|
|
4315
4411
|
const targetSnapshot = createEmptyState(extractedUrl, this.rootComponentType).snapshot;
|
|
4316
|
-
overallTransitionState = {
|
|
4412
|
+
this.currentTransition = overallTransitionState = {
|
|
4317
4413
|
...t,
|
|
4318
4414
|
targetSnapshot,
|
|
4319
4415
|
urlAfterRedirects: extractedUrl,
|
|
@@ -4329,10 +4425,9 @@ class NavigationTransitions {
|
|
|
4329
4425
|
*/
|
|
4330
4426
|
const reason = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4331
4427
|
`Navigation was ignored because the UrlHandlingStrategy` +
|
|
4332
|
-
` indicated neither the current URL ${
|
|
4428
|
+
` indicated neither the current URL ${t.currentRawUrl} nor target URL ${t.rawUrl} should be processed.` :
|
|
4333
4429
|
'';
|
|
4334
|
-
this.events.next(new NavigationSkipped(t.id,
|
|
4335
|
-
router.rawUrlTree = t.rawUrl;
|
|
4430
|
+
this.events.next(new NavigationSkipped(t.id, this.urlSerializer.serialize(t.extractedUrl), reason, 1 /* NavigationSkippedCode.IgnoredByUrlHandlingStrategy */));
|
|
4336
4431
|
t.resolve(null);
|
|
4337
4432
|
return EMPTY;
|
|
4338
4433
|
}
|
|
@@ -4342,7 +4437,7 @@ class NavigationTransitions {
|
|
|
4342
4437
|
const guardsStart = new GuardsCheckStart(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4343
4438
|
this.events.next(guardsStart);
|
|
4344
4439
|
}), map(t => {
|
|
4345
|
-
overallTransitionState = {
|
|
4440
|
+
this.currentTransition = overallTransitionState = {
|
|
4346
4441
|
...t,
|
|
4347
4442
|
guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts)
|
|
4348
4443
|
};
|
|
@@ -4356,7 +4451,6 @@ class NavigationTransitions {
|
|
|
4356
4451
|
this.events.next(guardsEnd);
|
|
4357
4452
|
}), filter(t => {
|
|
4358
4453
|
if (!t.guardsResult) {
|
|
4359
|
-
router.restoreHistory(t);
|
|
4360
4454
|
this.cancelNavigationTransition(t, '', 3 /* NavigationCancellationCode.GuardRejected */);
|
|
4361
4455
|
return false;
|
|
4362
4456
|
}
|
|
@@ -4370,11 +4464,10 @@ class NavigationTransitions {
|
|
|
4370
4464
|
this.events.next(resolveStart);
|
|
4371
4465
|
}), switchMap(t => {
|
|
4372
4466
|
let dataResolved = false;
|
|
4373
|
-
return of(t).pipe(resolveData(
|
|
4467
|
+
return of(t).pipe(resolveData(this.paramsInheritanceStrategy, this.environmentInjector), tap({
|
|
4374
4468
|
next: () => dataResolved = true,
|
|
4375
4469
|
complete: () => {
|
|
4376
4470
|
if (!dataResolved) {
|
|
4377
|
-
router.restoreHistory(t);
|
|
4378
4471
|
this.cancelNavigationTransition(t, (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4379
4472
|
`At least one route resolver didn't emit any value.` :
|
|
4380
4473
|
'', 2 /* NavigationCancellationCode.NoDataFromResolver */);
|
|
@@ -4408,26 +4501,11 @@ class NavigationTransitions {
|
|
|
4408
4501
|
.pipe(defaultIfEmpty(), take(1));
|
|
4409
4502
|
}), switchTap(() => this.afterPreactivation()), map((t) => {
|
|
4410
4503
|
const targetRouterState = createRouterState(router.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
Therefore before activation, we need to update router properties storing
|
|
4417
|
-
the current URL and the RouterState, as well as updated the browser URL.
|
|
4418
|
-
All this should happen *before* activating. */
|
|
4419
|
-
tap((t) => {
|
|
4420
|
-
router.currentUrlTree = t.urlAfterRedirects;
|
|
4421
|
-
router.rawUrlTree =
|
|
4422
|
-
router.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4423
|
-
router.routerState =
|
|
4424
|
-
t.targetRouterState;
|
|
4425
|
-
if (router.urlUpdateStrategy === 'deferred') {
|
|
4426
|
-
if (!t.extras.skipLocationChange) {
|
|
4427
|
-
router.setBrowserUrl(router.rawUrlTree, t);
|
|
4428
|
-
}
|
|
4429
|
-
router.browserUrlTree = t.urlAfterRedirects;
|
|
4430
|
-
}
|
|
4504
|
+
this.currentTransition =
|
|
4505
|
+
overallTransitionState = { ...t, targetRouterState };
|
|
4506
|
+
return overallTransitionState;
|
|
4507
|
+
}), tap(() => {
|
|
4508
|
+
this.events.next(new BeforeActivateRoutes());
|
|
4431
4509
|
}), activateRoutes(this.rootContexts, router.routeReuseStrategy, (evt) => this.events.next(evt), this.inputBindingEnabled),
|
|
4432
4510
|
// Ensure that if some observable used to drive the transition doesn't
|
|
4433
4511
|
// complete, the navigation still finalizes This should never happen, but
|
|
@@ -4436,15 +4514,24 @@ class NavigationTransitions {
|
|
|
4436
4514
|
next: (t) => {
|
|
4437
4515
|
completed = true;
|
|
4438
4516
|
this.lastSuccessfulNavigation = this.currentNavigation;
|
|
4439
|
-
|
|
4440
|
-
this.
|
|
4441
|
-
router.titleStrategy?.updateTitle(t.targetRouterState.snapshot);
|
|
4517
|
+
this.events.next(new NavigationEnd(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects)));
|
|
4518
|
+
this.titleStrategy?.updateTitle(t.targetRouterState.snapshot);
|
|
4442
4519
|
t.resolve(true);
|
|
4443
4520
|
},
|
|
4444
4521
|
complete: () => {
|
|
4445
4522
|
completed = true;
|
|
4446
4523
|
}
|
|
4447
|
-
}),
|
|
4524
|
+
}),
|
|
4525
|
+
// There used to be a lot more logic happening directly within the
|
|
4526
|
+
// transition Observable. Some of this logic has been refactored out to
|
|
4527
|
+
// other places but there may still be errors that happen there. This gives
|
|
4528
|
+
// us a way to cancel the transition from the outside. This may also be
|
|
4529
|
+
// required in the future to support something like the abort signal of the
|
|
4530
|
+
// Navigation API where the navigation gets aborted from outside the
|
|
4531
|
+
// transition.
|
|
4532
|
+
takeUntil(this.transitionAbortSubject.pipe(tap(err => {
|
|
4533
|
+
throw err;
|
|
4534
|
+
}))), finalize(() => {
|
|
4448
4535
|
/* When the navigation stream finishes either through error or success,
|
|
4449
4536
|
* we set the `completed` or `errored` flag. However, there are some
|
|
4450
4537
|
* situations where we could get here without either of those being set.
|
|
@@ -4468,47 +4555,20 @@ class NavigationTransitions {
|
|
|
4468
4555
|
/* This error type is issued during Redirect, and is handled as a
|
|
4469
4556
|
* cancellation rather than an error. */
|
|
4470
4557
|
if (isNavigationCancelingError$1(e)) {
|
|
4471
|
-
|
|
4472
|
-
// Set property only if we're not redirecting. If we landed on a page
|
|
4473
|
-
// and redirect to `/` route, the new navigation is going to see the
|
|
4474
|
-
// `/` isn't a change from the default currentUrlTree and won't
|
|
4475
|
-
// navigate. This is only applicable with initial navigation, so
|
|
4476
|
-
// setting `navigated` only when not redirecting resolves this
|
|
4477
|
-
// scenario.
|
|
4478
|
-
router.navigated = true;
|
|
4479
|
-
router.restoreHistory(overallTransitionState, true);
|
|
4480
|
-
}
|
|
4481
|
-
const navCancel = new NavigationCancel(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e.message, e.cancellationCode);
|
|
4482
|
-
this.events.next(navCancel);
|
|
4558
|
+
this.events.next(new NavigationCancel(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e.message, e.cancellationCode));
|
|
4483
4559
|
// When redirecting, we need to delay resolving the navigation
|
|
4484
4560
|
// promise and push it to the redirect navigation
|
|
4485
4561
|
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4486
4562
|
overallTransitionState.resolve(false);
|
|
4487
4563
|
}
|
|
4488
4564
|
else {
|
|
4489
|
-
|
|
4490
|
-
const extras = {
|
|
4491
|
-
skipLocationChange: overallTransitionState.extras.skipLocationChange,
|
|
4492
|
-
// The URL is already updated at this point if we have 'eager' URL
|
|
4493
|
-
// updates or if the navigation was triggered by the browser (back
|
|
4494
|
-
// button, URL bar, etc). We want to replace that item in history
|
|
4495
|
-
// if the navigation is rejected.
|
|
4496
|
-
replaceUrl: router.urlUpdateStrategy === 'eager' ||
|
|
4497
|
-
isBrowserTriggeredNavigation(overallTransitionState.source)
|
|
4498
|
-
};
|
|
4499
|
-
router.scheduleNavigation(mergedTree, IMPERATIVE_NAVIGATION, null, extras, {
|
|
4500
|
-
resolve: overallTransitionState.resolve,
|
|
4501
|
-
reject: overallTransitionState.reject,
|
|
4502
|
-
promise: overallTransitionState.promise
|
|
4503
|
-
});
|
|
4565
|
+
this.events.next(new RedirectRequest(e.url));
|
|
4504
4566
|
}
|
|
4505
4567
|
/* All other errors should reset to the router's internal URL reference
|
|
4506
4568
|
* to the pre-error state. */
|
|
4507
4569
|
}
|
|
4508
4570
|
else {
|
|
4509
|
-
|
|
4510
|
-
const navError = new NavigationError(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e, overallTransitionState.targetSnapshot ?? undefined);
|
|
4511
|
-
this.events.next(navError);
|
|
4571
|
+
this.events.next(new NavigationError(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e, overallTransitionState.targetSnapshot ?? undefined));
|
|
4512
4572
|
try {
|
|
4513
4573
|
overallTransitionState.resolve(router.errorHandler(e));
|
|
4514
4574
|
}
|
|
@@ -4526,10 +4586,10 @@ class NavigationTransitions {
|
|
|
4526
4586
|
this.events.next(navCancel);
|
|
4527
4587
|
t.resolve(false);
|
|
4528
4588
|
}
|
|
4529
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4530
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4589
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4590
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
|
|
4531
4591
|
}
|
|
4532
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NavigationTransitions, decorators: [{
|
|
4533
4593
|
type: Injectable,
|
|
4534
4594
|
args: [{ providedIn: 'root' }]
|
|
4535
4595
|
}], ctorParameters: function () { return []; } });
|
|
@@ -4537,83 +4597,6 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
4537
4597
|
return source !== IMPERATIVE_NAVIGATION;
|
|
4538
4598
|
}
|
|
4539
4599
|
|
|
4540
|
-
/**
|
|
4541
|
-
* Provides a strategy for setting the page title after a router navigation.
|
|
4542
|
-
*
|
|
4543
|
-
* The built-in implementation traverses the router state snapshot and finds the deepest primary
|
|
4544
|
-
* outlet with `title` property. Given the `Routes` below, navigating to
|
|
4545
|
-
* `/base/child(popup:aux)` would result in the document title being set to "child".
|
|
4546
|
-
* ```
|
|
4547
|
-
* [
|
|
4548
|
-
* {path: 'base', title: 'base', children: [
|
|
4549
|
-
* {path: 'child', title: 'child'},
|
|
4550
|
-
* ],
|
|
4551
|
-
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
|
4552
|
-
* ]
|
|
4553
|
-
* ```
|
|
4554
|
-
*
|
|
4555
|
-
* This class can be used as a base class for custom title strategies. That is, you can create your
|
|
4556
|
-
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
|
4557
|
-
* from the named outlet is never used. However, a custom strategy might be implemented to
|
|
4558
|
-
* incorporate titles in named outlets.
|
|
4559
|
-
*
|
|
4560
|
-
* @publicApi
|
|
4561
|
-
* @see [Page title guide](guide/router#setting-the-page-title)
|
|
4562
|
-
*/
|
|
4563
|
-
class TitleStrategy {
|
|
4564
|
-
/**
|
|
4565
|
-
* @returns The `title` of the deepest primary route.
|
|
4566
|
-
*/
|
|
4567
|
-
buildTitle(snapshot) {
|
|
4568
|
-
let pageTitle;
|
|
4569
|
-
let route = snapshot.root;
|
|
4570
|
-
while (route !== undefined) {
|
|
4571
|
-
pageTitle = this.getResolvedTitleForRoute(route) ?? pageTitle;
|
|
4572
|
-
route = route.children.find(child => child.outlet === PRIMARY_OUTLET);
|
|
4573
|
-
}
|
|
4574
|
-
return pageTitle;
|
|
4575
|
-
}
|
|
4576
|
-
/**
|
|
4577
|
-
* Given an `ActivatedRouteSnapshot`, returns the final value of the
|
|
4578
|
-
* `Route.title` property, which can either be a static string or a resolved value.
|
|
4579
|
-
*/
|
|
4580
|
-
getResolvedTitleForRoute(snapshot) {
|
|
4581
|
-
return snapshot.data[RouteTitleKey];
|
|
4582
|
-
}
|
|
4583
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4584
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
|
|
4585
|
-
}
|
|
4586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4587
|
-
type: Injectable,
|
|
4588
|
-
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4589
|
-
}] });
|
|
4590
|
-
/**
|
|
4591
|
-
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
|
|
4592
|
-
*/
|
|
4593
|
-
class DefaultTitleStrategy extends TitleStrategy {
|
|
4594
|
-
constructor(title) {
|
|
4595
|
-
super();
|
|
4596
|
-
this.title = title;
|
|
4597
|
-
}
|
|
4598
|
-
/**
|
|
4599
|
-
* Sets the title of the browser to the given value.
|
|
4600
|
-
*
|
|
4601
|
-
* @param title The `pageTitle` from the deepest primary route.
|
|
4602
|
-
*/
|
|
4603
|
-
updateTitle(snapshot) {
|
|
4604
|
-
const title = this.buildTitle(snapshot);
|
|
4605
|
-
if (title !== undefined) {
|
|
4606
|
-
this.title.setTitle(title);
|
|
4607
|
-
}
|
|
4608
|
-
}
|
|
4609
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4610
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
|
|
4611
|
-
}
|
|
4612
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4613
|
-
type: Injectable,
|
|
4614
|
-
args: [{ providedIn: 'root' }]
|
|
4615
|
-
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
4616
|
-
|
|
4617
4600
|
/**
|
|
4618
4601
|
* @description
|
|
4619
4602
|
*
|
|
@@ -4622,10 +4605,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.0",
|
|
|
4622
4605
|
* @publicApi
|
|
4623
4606
|
*/
|
|
4624
4607
|
class RouteReuseStrategy {
|
|
4625
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4626
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4608
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4609
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
|
|
4627
4610
|
}
|
|
4628
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouteReuseStrategy, decorators: [{
|
|
4629
4612
|
type: Injectable,
|
|
4630
4613
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
|
|
4631
4614
|
}] });
|
|
@@ -4676,24 +4659,14 @@ class BaseRouteReuseStrategy {
|
|
|
4676
4659
|
}
|
|
4677
4660
|
}
|
|
4678
4661
|
class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
4679
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4680
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4662
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4663
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
|
|
4681
4664
|
}
|
|
4682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
|
|
4683
4666
|
type: Injectable,
|
|
4684
4667
|
args: [{ providedIn: 'root' }]
|
|
4685
4668
|
}] });
|
|
4686
4669
|
|
|
4687
|
-
/**
|
|
4688
|
-
* A [DI token](guide/glossary/#di-token) for the router service.
|
|
4689
|
-
*
|
|
4690
|
-
* @publicApi
|
|
4691
|
-
*/
|
|
4692
|
-
const ROUTER_CONFIGURATION = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'router config' : '', {
|
|
4693
|
-
providedIn: 'root',
|
|
4694
|
-
factory: () => ({}),
|
|
4695
|
-
});
|
|
4696
|
-
|
|
4697
4670
|
/**
|
|
4698
4671
|
* @description
|
|
4699
4672
|
*
|
|
@@ -4702,10 +4675,10 @@ const ROUTER_CONFIGURATION = new InjectionToken((typeof ngDevMode === 'undefined
|
|
|
4702
4675
|
* @publicApi
|
|
4703
4676
|
*/
|
|
4704
4677
|
class UrlHandlingStrategy {
|
|
4705
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4706
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4679
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
|
|
4707
4680
|
}
|
|
4708
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
|
|
4709
4682
|
type: Injectable,
|
|
4710
4683
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
|
|
4711
4684
|
}] });
|
|
@@ -4722,10 +4695,10 @@ class DefaultUrlHandlingStrategy {
|
|
|
4722
4695
|
merge(newUrlPart, wholeUrl) {
|
|
4723
4696
|
return newUrlPart;
|
|
4724
4697
|
}
|
|
4725
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4726
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4699
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
|
|
4727
4700
|
}
|
|
4728
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
4701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
|
|
4729
4702
|
type: Injectable,
|
|
4730
4703
|
args: [{ providedIn: 'root' }]
|
|
4731
4704
|
}] });
|
|
@@ -4814,9 +4787,9 @@ class Router {
|
|
|
4814
4787
|
*/
|
|
4815
4788
|
get browserPageId() {
|
|
4816
4789
|
if (this.canceledNavigationResolution !== 'computed') {
|
|
4817
|
-
return
|
|
4790
|
+
return this.currentPageId;
|
|
4818
4791
|
}
|
|
4819
|
-
return this.location.getState()?.ɵrouterPageId;
|
|
4792
|
+
return this.location.getState()?.ɵrouterPageId ?? this.currentPageId;
|
|
4820
4793
|
}
|
|
4821
4794
|
/**
|
|
4822
4795
|
* An event stream for routing events.
|
|
@@ -4826,7 +4799,7 @@ class Router {
|
|
|
4826
4799
|
// cleanup: tests are doing `(route.events as Subject<Event>).next(...)`. This isn't
|
|
4827
4800
|
// allowed/supported but we still have to fix these or file bugs against the teams before making
|
|
4828
4801
|
// the change.
|
|
4829
|
-
return this.
|
|
4802
|
+
return this._events;
|
|
4830
4803
|
}
|
|
4831
4804
|
constructor() {
|
|
4832
4805
|
this.disposed = false;
|
|
@@ -4841,6 +4814,12 @@ class Router {
|
|
|
4841
4814
|
this.currentPageId = 0;
|
|
4842
4815
|
this.console = inject(ɵConsole);
|
|
4843
4816
|
this.isNgZoneEnabled = false;
|
|
4817
|
+
/**
|
|
4818
|
+
* The private `Subject` type for the public events exposed in the getter. This is used internally
|
|
4819
|
+
* to push events to. The separate field allows us to expose separate types in the public API
|
|
4820
|
+
* (i.e., an Observable rather than the Subject).
|
|
4821
|
+
*/
|
|
4822
|
+
this._events = new Subject();
|
|
4844
4823
|
this.options = inject(ROUTER_CONFIGURATION, { optional: true }) || {};
|
|
4845
4824
|
this.pendingTasks = inject(ɵInitialRenderPendingTasks);
|
|
4846
4825
|
/**
|
|
@@ -4857,8 +4836,6 @@ class Router {
|
|
|
4857
4836
|
* The most common case is a `%` sign
|
|
4858
4837
|
* that's not encoded and is not part of a percent encoded sequence.
|
|
4859
4838
|
*
|
|
4860
|
-
* @deprecated URI parsing errors should be handled in the `UrlSerializer`.
|
|
4861
|
-
*
|
|
4862
4839
|
* @see {@link RouterModule}
|
|
4863
4840
|
*/
|
|
4864
4841
|
this.malformedUriErrorHandler = this.options.malformedUriErrorHandler || defaultMalformedUriErrorHandler;
|
|
@@ -4883,13 +4860,6 @@ class Router {
|
|
|
4883
4860
|
* `{provide: RouteReuseStrategy, useClass: MyStrategy}`.
|
|
4884
4861
|
*/
|
|
4885
4862
|
this.routeReuseStrategy = inject(RouteReuseStrategy);
|
|
4886
|
-
/**
|
|
4887
|
-
* A strategy for setting the title based on the `routerState`.
|
|
4888
|
-
*
|
|
4889
|
-
* @deprecated Configure using `providers` instead:
|
|
4890
|
-
* `{provide: TitleStrategy, useClass: MyStrategy}`.
|
|
4891
|
-
*/
|
|
4892
|
-
this.titleStrategy = inject(TitleStrategy);
|
|
4893
4863
|
/**
|
|
4894
4864
|
* How to handle a navigation request to the current URL.
|
|
4895
4865
|
*
|
|
@@ -4900,33 +4870,6 @@ class Router {
|
|
|
4900
4870
|
* @see {@link RouterModule}
|
|
4901
4871
|
*/
|
|
4902
4872
|
this.onSameUrlNavigation = this.options.onSameUrlNavigation || 'ignore';
|
|
4903
|
-
/**
|
|
4904
|
-
* How to merge parameters, data, resolved data, and title from parent to child
|
|
4905
|
-
* routes. One of:
|
|
4906
|
-
*
|
|
4907
|
-
* - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
|
|
4908
|
-
* for path-less or component-less routes.
|
|
4909
|
-
* - `'always'` : Inherit parent parameters, data, and resolved data
|
|
4910
|
-
* for all child routes.
|
|
4911
|
-
*
|
|
4912
|
-
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
4913
|
-
* @see {@link withRouterConfig}
|
|
4914
|
-
* @see {@link provideRouter}
|
|
4915
|
-
* @see {@link RouterModule}
|
|
4916
|
-
*/
|
|
4917
|
-
this.paramsInheritanceStrategy = this.options.paramsInheritanceStrategy || 'emptyOnly';
|
|
4918
|
-
/**
|
|
4919
|
-
* Determines when the router updates the browser URL.
|
|
4920
|
-
* By default (`"deferred"`), updates the browser URL after navigation has finished.
|
|
4921
|
-
* Set to `'eager'` to update the browser URL at the beginning of navigation.
|
|
4922
|
-
* You can choose to update early so that, if navigation fails,
|
|
4923
|
-
* you can show an error message with the URL that failed.
|
|
4924
|
-
*
|
|
4925
|
-
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
4926
|
-
* @see {@link withRouterConfig}
|
|
4927
|
-
* @see {@link provideRouter}
|
|
4928
|
-
* @see {@link RouterModule}
|
|
4929
|
-
*/
|
|
4930
4873
|
this.urlUpdateStrategy = this.options.urlUpdateStrategy || 'deferred';
|
|
4931
4874
|
/**
|
|
4932
4875
|
* Configures how the Router attempts to restore state when a navigation is cancelled.
|
|
@@ -4949,7 +4892,6 @@ class Router {
|
|
|
4949
4892
|
*
|
|
4950
4893
|
* The default value is `replace`.
|
|
4951
4894
|
*
|
|
4952
|
-
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
4953
4895
|
* @see {@link withRouterConfig}
|
|
4954
4896
|
* @see {@link provideRouter}
|
|
4955
4897
|
* @see {@link RouterModule}
|
|
@@ -4966,18 +4908,110 @@ class Router {
|
|
|
4966
4908
|
* `bindToComponentInputs` in the `ExtraOptions` of `RouterModule.forRoot`.
|
|
4967
4909
|
*/
|
|
4968
4910
|
this.componentInputBindingEnabled = !!inject(INPUT_BINDER, { optional: true });
|
|
4911
|
+
this.eventsSubscription = new Subscription();
|
|
4969
4912
|
this.isNgZoneEnabled = inject(NgZone) instanceof NgZone && NgZone.isInAngularZone();
|
|
4970
4913
|
this.resetConfig(this.config);
|
|
4971
4914
|
this.currentUrlTree = new UrlTree();
|
|
4972
4915
|
this.rawUrlTree = this.currentUrlTree;
|
|
4973
4916
|
this.browserUrlTree = this.currentUrlTree;
|
|
4974
4917
|
this.routerState = createEmptyState(this.currentUrlTree, null);
|
|
4975
|
-
this.navigationTransitions.setupNavigations(this
|
|
4918
|
+
this.navigationTransitions.setupNavigations(this, this.currentUrlTree, this.routerState)
|
|
4919
|
+
.subscribe(t => {
|
|
4976
4920
|
this.lastSuccessfulId = t.id;
|
|
4977
|
-
this.currentPageId = this.browserPageId
|
|
4921
|
+
this.currentPageId = this.browserPageId;
|
|
4978
4922
|
}, e => {
|
|
4979
4923
|
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
4980
4924
|
});
|
|
4925
|
+
this.subscribeToNavigationEvents();
|
|
4926
|
+
}
|
|
4927
|
+
subscribeToNavigationEvents() {
|
|
4928
|
+
const subscription = this.navigationTransitions.events.subscribe(e => {
|
|
4929
|
+
try {
|
|
4930
|
+
const { currentTransition } = this.navigationTransitions;
|
|
4931
|
+
if (currentTransition === null) {
|
|
4932
|
+
if (isPublicRouterEvent(e)) {
|
|
4933
|
+
this._events.next(e);
|
|
4934
|
+
}
|
|
4935
|
+
return;
|
|
4936
|
+
}
|
|
4937
|
+
if (e instanceof NavigationStart) {
|
|
4938
|
+
// If the source of the navigation is from a browser event, the URL is
|
|
4939
|
+
// already updated. We already need to sync the internal state.
|
|
4940
|
+
if (isBrowserTriggeredNavigation(currentTransition.source)) {
|
|
4941
|
+
this.browserUrlTree = currentTransition.extractedUrl;
|
|
4942
|
+
}
|
|
4943
|
+
}
|
|
4944
|
+
else if (e instanceof NavigationSkipped) {
|
|
4945
|
+
this.rawUrlTree = currentTransition.rawUrl;
|
|
4946
|
+
}
|
|
4947
|
+
else if (e instanceof RoutesRecognized) {
|
|
4948
|
+
if (this.urlUpdateStrategy === 'eager') {
|
|
4949
|
+
if (!currentTransition.extras.skipLocationChange) {
|
|
4950
|
+
const rawUrl = this.urlHandlingStrategy.merge(currentTransition.urlAfterRedirects, currentTransition.rawUrl);
|
|
4951
|
+
this.setBrowserUrl(rawUrl, currentTransition);
|
|
4952
|
+
}
|
|
4953
|
+
this.browserUrlTree = currentTransition.urlAfterRedirects;
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
else if (e instanceof BeforeActivateRoutes) {
|
|
4957
|
+
this.currentUrlTree = currentTransition.urlAfterRedirects;
|
|
4958
|
+
this.rawUrlTree = this.urlHandlingStrategy.merge(currentTransition.urlAfterRedirects, currentTransition.rawUrl);
|
|
4959
|
+
this.routerState = currentTransition.targetRouterState;
|
|
4960
|
+
if (this.urlUpdateStrategy === 'deferred') {
|
|
4961
|
+
if (!currentTransition.extras.skipLocationChange) {
|
|
4962
|
+
this.setBrowserUrl(this.rawUrlTree, currentTransition);
|
|
4963
|
+
}
|
|
4964
|
+
this.browserUrlTree = currentTransition.urlAfterRedirects;
|
|
4965
|
+
}
|
|
4966
|
+
}
|
|
4967
|
+
else if (e instanceof NavigationCancel) {
|
|
4968
|
+
if (e.code !== 0 /* NavigationCancellationCode.Redirect */ &&
|
|
4969
|
+
e.code !== 1 /* NavigationCancellationCode.SupersededByNewNavigation */) {
|
|
4970
|
+
// It seems weird that `navigated` is set to `true` when the navigation is rejected,
|
|
4971
|
+
// however it's how things were written initially. Investigation would need to be done
|
|
4972
|
+
// to determine if this can be removed.
|
|
4973
|
+
this.navigated = true;
|
|
4974
|
+
}
|
|
4975
|
+
if (e.code === 3 /* NavigationCancellationCode.GuardRejected */ ||
|
|
4976
|
+
e.code === 2 /* NavigationCancellationCode.NoDataFromResolver */) {
|
|
4977
|
+
this.restoreHistory(currentTransition);
|
|
4978
|
+
}
|
|
4979
|
+
}
|
|
4980
|
+
else if (e instanceof RedirectRequest) {
|
|
4981
|
+
const mergedTree = this.urlHandlingStrategy.merge(e.url, currentTransition.currentRawUrl);
|
|
4982
|
+
const extras = {
|
|
4983
|
+
skipLocationChange: currentTransition.extras.skipLocationChange,
|
|
4984
|
+
// The URL is already updated at this point if we have 'eager' URL
|
|
4985
|
+
// updates or if the navigation was triggered by the browser (back
|
|
4986
|
+
// button, URL bar, etc). We want to replace that item in history
|
|
4987
|
+
// if the navigation is rejected.
|
|
4988
|
+
replaceUrl: this.urlUpdateStrategy === 'eager' ||
|
|
4989
|
+
isBrowserTriggeredNavigation(currentTransition.source)
|
|
4990
|
+
};
|
|
4991
|
+
this.scheduleNavigation(mergedTree, IMPERATIVE_NAVIGATION, null, extras, {
|
|
4992
|
+
resolve: currentTransition.resolve,
|
|
4993
|
+
reject: currentTransition.reject,
|
|
4994
|
+
promise: currentTransition.promise
|
|
4995
|
+
});
|
|
4996
|
+
}
|
|
4997
|
+
if (e instanceof NavigationError) {
|
|
4998
|
+
this.restoreHistory(currentTransition, true);
|
|
4999
|
+
}
|
|
5000
|
+
if (e instanceof NavigationEnd) {
|
|
5001
|
+
this.navigated = true;
|
|
5002
|
+
}
|
|
5003
|
+
// Note that it's important to have the Router process the events _before_ the event is
|
|
5004
|
+
// pushed through the public observable. This ensures the correct router state is in place
|
|
5005
|
+
// before applications observe the events.
|
|
5006
|
+
if (isPublicRouterEvent(e)) {
|
|
5007
|
+
this._events.next(e);
|
|
5008
|
+
}
|
|
5009
|
+
}
|
|
5010
|
+
catch (e) {
|
|
5011
|
+
this.navigationTransitions.transitionAbortSubject.next(e);
|
|
5012
|
+
}
|
|
5013
|
+
});
|
|
5014
|
+
this.eventsSubscription.add(subscription);
|
|
4981
5015
|
}
|
|
4982
5016
|
/** @internal */
|
|
4983
5017
|
resetRootComponentType(rootComponentType) {
|
|
@@ -5100,6 +5134,7 @@ class Router {
|
|
|
5100
5134
|
this.locationSubscription = undefined;
|
|
5101
5135
|
}
|
|
5102
5136
|
this.disposed = true;
|
|
5137
|
+
this.eventsSubscription.unsubscribe();
|
|
5103
5138
|
}
|
|
5104
5139
|
/**
|
|
5105
5140
|
* Appends URL segments to the current URL tree to create a new URL tree.
|
|
@@ -5333,6 +5368,7 @@ class Router {
|
|
|
5333
5368
|
restoredState,
|
|
5334
5369
|
currentUrlTree: this.currentUrlTree,
|
|
5335
5370
|
currentRawUrl: this.currentUrlTree,
|
|
5371
|
+
currentBrowserUrl: this.browserUrlTree,
|
|
5336
5372
|
rawUrl,
|
|
5337
5373
|
extras,
|
|
5338
5374
|
resolve,
|
|
@@ -5362,7 +5398,7 @@ class Router {
|
|
|
5362
5398
|
else {
|
|
5363
5399
|
const state = {
|
|
5364
5400
|
...transition.extras.state,
|
|
5365
|
-
...this.generateNgRouterState(transition.id,
|
|
5401
|
+
...this.generateNgRouterState(transition.id, this.browserPageId + 1)
|
|
5366
5402
|
};
|
|
5367
5403
|
this.location.go(path, '', state);
|
|
5368
5404
|
}
|
|
@@ -5374,7 +5410,7 @@ class Router {
|
|
|
5374
5410
|
*/
|
|
5375
5411
|
restoreHistory(transition, restoringFromCaughtError = false) {
|
|
5376
5412
|
if (this.canceledNavigationResolution === 'computed') {
|
|
5377
|
-
const currentBrowserPageId = this.browserPageId
|
|
5413
|
+
const currentBrowserPageId = this.browserPageId;
|
|
5378
5414
|
const targetPagePosition = this.currentPageId - currentBrowserPageId;
|
|
5379
5415
|
if (targetPagePosition !== 0) {
|
|
5380
5416
|
this.location.historyGo(targetPagePosition);
|
|
@@ -5425,10 +5461,10 @@ class Router {
|
|
|
5425
5461
|
}
|
|
5426
5462
|
return { navigationId };
|
|
5427
5463
|
}
|
|
5428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5429
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5464
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5465
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: Router, providedIn: 'root' }); }
|
|
5430
5466
|
}
|
|
5431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: Router, decorators: [{
|
|
5432
5468
|
type: Injectable,
|
|
5433
5469
|
args: [{ providedIn: 'root' }]
|
|
5434
5470
|
}], ctorParameters: function () { return []; } });
|
|
@@ -5441,6 +5477,9 @@ function validateCommands(commands) {
|
|
|
5441
5477
|
}
|
|
5442
5478
|
}
|
|
5443
5479
|
}
|
|
5480
|
+
function isPublicRouterEvent(e) {
|
|
5481
|
+
return (!(e instanceof BeforeActivateRoutes) && !(e instanceof RedirectRequest));
|
|
5482
|
+
}
|
|
5444
5483
|
|
|
5445
5484
|
/**
|
|
5446
5485
|
* @description
|
|
@@ -5696,10 +5735,10 @@ class RouterLink {
|
|
|
5696
5735
|
preserveFragment: this.preserveFragment,
|
|
5697
5736
|
});
|
|
5698
5737
|
}
|
|
5699
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5700
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
5738
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5739
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0.0-next.2", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: ["preserveFragment", "preserveFragment", booleanAttribute], skipLocationChange: ["skipLocationChange", "skipLocationChange", booleanAttribute], replaceUrl: ["replaceUrl", "replaceUrl", booleanAttribute], routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
5701
5740
|
}
|
|
5702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterLink, decorators: [{
|
|
5703
5742
|
type: Directive,
|
|
5704
5743
|
args: [{
|
|
5705
5744
|
selector: '[routerLink]',
|
|
@@ -5826,7 +5865,7 @@ class RouterLinkActive {
|
|
|
5826
5865
|
*
|
|
5827
5866
|
* These options are passed to the `Router.isActive()` function.
|
|
5828
5867
|
*
|
|
5829
|
-
* @see Router
|
|
5868
|
+
* @see {@link Router#isActive}
|
|
5830
5869
|
*/
|
|
5831
5870
|
this.routerLinkActiveOptions = { exact: false };
|
|
5832
5871
|
/**
|
|
@@ -5922,10 +5961,10 @@ class RouterLinkActive {
|
|
|
5922
5961
|
const isActiveCheckFn = this.isLinkActive(this.router);
|
|
5923
5962
|
return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
|
|
5924
5963
|
}
|
|
5925
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5926
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0-next.
|
|
5964
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5965
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0-next.2", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 }); }
|
|
5927
5966
|
}
|
|
5928
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5929
5968
|
type: Directive,
|
|
5930
5969
|
args: [{
|
|
5931
5970
|
selector: '[routerLinkActive]',
|
|
@@ -5977,10 +6016,10 @@ class PreloadAllModules {
|
|
|
5977
6016
|
preload(route, fn) {
|
|
5978
6017
|
return fn().pipe(catchError(() => of(null)));
|
|
5979
6018
|
}
|
|
5980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
5981
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6019
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6020
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
|
|
5982
6021
|
}
|
|
5983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
5984
6023
|
type: Injectable,
|
|
5985
6024
|
args: [{ providedIn: 'root' }]
|
|
5986
6025
|
}] });
|
|
@@ -5997,10 +6036,10 @@ class NoPreloading {
|
|
|
5997
6036
|
preload(route, fn) {
|
|
5998
6037
|
return of(null);
|
|
5999
6038
|
}
|
|
6000
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6001
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6040
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
|
|
6002
6041
|
}
|
|
6003
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6004
6043
|
type: Injectable,
|
|
6005
6044
|
args: [{ providedIn: 'root' }]
|
|
6006
6045
|
}] });
|
|
@@ -6093,10 +6132,10 @@ class RouterPreloader {
|
|
|
6093
6132
|
}
|
|
6094
6133
|
});
|
|
6095
6134
|
}
|
|
6096
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6097
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6136
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
|
|
6098
6137
|
}
|
|
6099
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6100
6139
|
type: Injectable,
|
|
6101
6140
|
args: [{ providedIn: 'root' }]
|
|
6102
6141
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
@@ -6189,10 +6228,10 @@ class RouterScroller {
|
|
|
6189
6228
|
this.routerEventsSubscription?.unsubscribe();
|
|
6190
6229
|
this.scrollEventsSubscription?.unsubscribe();
|
|
6191
6230
|
}
|
|
6192
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6193
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6231
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6232
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterScroller }); }
|
|
6194
6233
|
}
|
|
6195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6196
6235
|
type: Injectable
|
|
6197
6236
|
}], ctorParameters: function () { return [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }]; } });
|
|
6198
6237
|
|
|
@@ -6799,11 +6838,11 @@ class RouterModule {
|
|
|
6799
6838
|
providers: [{ provide: ROUTES, multi: true, useValue: routes }],
|
|
6800
6839
|
};
|
|
6801
6840
|
}
|
|
6802
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6803
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.
|
|
6804
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6841
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6842
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
|
|
6843
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterModule }); }
|
|
6805
6844
|
}
|
|
6806
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.
|
|
6845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.2", ngImport: i0, type: RouterModule, decorators: [{
|
|
6807
6846
|
type: NgModule,
|
|
6808
6847
|
args: [{
|
|
6809
6848
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -6948,7 +6987,7 @@ function mapToResolve(provider) {
|
|
|
6948
6987
|
/**
|
|
6949
6988
|
* @publicApi
|
|
6950
6989
|
*/
|
|
6951
|
-
const VERSION = new Version('17.0.0-next.
|
|
6990
|
+
const VERSION = new Version('17.0.0-next.2');
|
|
6952
6991
|
|
|
6953
6992
|
/**
|
|
6954
6993
|
* @module
|