@angular/router 15.1.0-next.0 → 15.1.0-next.1
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/components/empty_outlet.mjs +3 -3
- package/esm2020/src/deprecated_load_children.mjs +3 -1
- package/esm2020/src/directives/router_link.mjs +3 -3
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +3 -3
- package/esm2020/src/index.mjs +1 -1
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/navigation_transition.mjs +145 -84
- package/esm2020/src/page_title_strategy.mjs +6 -6
- package/esm2020/src/private_export.mjs +1 -1
- package/esm2020/src/provide_router.mjs +6 -3
- package/esm2020/src/route_reuse_strategy.mjs +6 -6
- package/esm2020/src/router.mjs +34 -93
- package/esm2020/src/router_config.mjs +1 -1
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +9 -7
- package/esm2020/src/router_outlet_context.mjs +3 -3
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +20 -21
- package/esm2020/src/router_state.mjs +1 -1
- package/esm2020/src/url_handling_strategy.mjs +6 -6
- package/esm2020/src/url_tree.mjs +4 -4
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +4 -4
- package/fesm2015/router.mjs +392 -387
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +386 -386
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +75 -49
- package/package.json +4 -4
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2015/router.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.1.0-next.
|
|
2
|
+
* @license Angular v15.1.0-next.1
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler,
|
|
8
|
+
import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, ɵConsole, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ENVIRONMENT_INITIALIZER, ApplicationRef, APP_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
11
11
|
import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
|
|
@@ -461,9 +461,9 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
461
461
|
*/
|
|
462
462
|
class UrlSerializer {
|
|
463
463
|
}
|
|
464
|
-
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
465
|
-
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
464
|
+
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
465
|
+
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
467
467
|
type: Injectable,
|
|
468
468
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
469
469
|
}] });
|
|
@@ -2419,9 +2419,9 @@ class ChildrenOutletContexts {
|
|
|
2419
2419
|
return this.contexts.get(childName) || null;
|
|
2420
2420
|
}
|
|
2421
2421
|
}
|
|
2422
|
-
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2423
|
-
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2422
|
+
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2423
|
+
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2425
2425
|
type: Injectable,
|
|
2426
2426
|
args: [{ providedIn: 'root' }]
|
|
2427
2427
|
}] });
|
|
@@ -2642,9 +2642,9 @@ class RouterOutlet {
|
|
|
2642
2642
|
this.activateEvents.emit(this.activated.instance);
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2646
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.
|
|
2647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2645
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2646
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.1", 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 });
|
|
2647
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2648
2648
|
type: Directive,
|
|
2649
2649
|
args: [{
|
|
2650
2650
|
selector: 'router-outlet',
|
|
@@ -2704,9 +2704,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2704
2704
|
*/
|
|
2705
2705
|
class ɵEmptyOutletComponent {
|
|
2706
2706
|
}
|
|
2707
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2708
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0-next.
|
|
2709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
2707
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2708
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.0-next.1", 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"] }] });
|
|
2709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2710
2710
|
type: Component,
|
|
2711
2711
|
args: [{
|
|
2712
2712
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -4340,6 +4340,19 @@ function switchTap(next) {
|
|
|
4340
4340
|
});
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
|
+
/**
|
|
4344
|
+
* @license
|
|
4345
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4346
|
+
*
|
|
4347
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4348
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4349
|
+
*/
|
|
4350
|
+
// This file exists to support the legacy `loadChildren: string` behavior being patched back into
|
|
4351
|
+
// Angular.
|
|
4352
|
+
function deprecatedLoadChildrenString(injector, loadChildren) {
|
|
4353
|
+
return null;
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4343
4356
|
/**
|
|
4344
4357
|
* @license
|
|
4345
4358
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4348,16 +4361,188 @@ function switchTap(next) {
|
|
|
4348
4361
|
* found in the LICENSE file at https://angular.io/license
|
|
4349
4362
|
*/
|
|
4350
4363
|
const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4364
|
+
/**
|
|
4365
|
+
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4366
|
+
*
|
|
4367
|
+
* `ROUTES` is a low level API for router configuration via dependency injection.
|
|
4368
|
+
*
|
|
4369
|
+
* We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
|
|
4370
|
+
* `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.
|
|
4371
|
+
*
|
|
4372
|
+
* @publicApi
|
|
4373
|
+
*/
|
|
4374
|
+
const ROUTES = new InjectionToken('ROUTES');
|
|
4375
|
+
class RouterConfigLoader {
|
|
4376
|
+
constructor(injector, compiler) {
|
|
4377
|
+
this.injector = injector;
|
|
4378
|
+
this.compiler = compiler;
|
|
4379
|
+
this.componentLoaders = new WeakMap();
|
|
4380
|
+
this.childrenLoaders = new WeakMap();
|
|
4381
|
+
}
|
|
4382
|
+
loadComponent(route) {
|
|
4383
|
+
if (this.componentLoaders.get(route)) {
|
|
4384
|
+
return this.componentLoaders.get(route);
|
|
4385
|
+
}
|
|
4386
|
+
else if (route._loadedComponent) {
|
|
4387
|
+
return of(route._loadedComponent);
|
|
4388
|
+
}
|
|
4389
|
+
if (this.onLoadStartListener) {
|
|
4390
|
+
this.onLoadStartListener(route);
|
|
4391
|
+
}
|
|
4392
|
+
const loadRunner = wrapIntoObservable(route.loadComponent())
|
|
4393
|
+
.pipe(map(maybeUnwrapDefaultExport), tap(component => {
|
|
4394
|
+
var _a;
|
|
4395
|
+
if (this.onLoadEndListener) {
|
|
4396
|
+
this.onLoadEndListener(route);
|
|
4397
|
+
}
|
|
4398
|
+
NG_DEV_MODE$5 && assertStandalone((_a = route.path) !== null && _a !== void 0 ? _a : '', component);
|
|
4399
|
+
route._loadedComponent = component;
|
|
4400
|
+
}), finalize(() => {
|
|
4401
|
+
this.componentLoaders.delete(route);
|
|
4402
|
+
}));
|
|
4403
|
+
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4404
|
+
const loader = new ConnectableObservable(loadRunner, () => new Subject()).pipe(refCount());
|
|
4405
|
+
this.componentLoaders.set(route, loader);
|
|
4406
|
+
return loader;
|
|
4407
|
+
}
|
|
4408
|
+
loadChildren(parentInjector, route) {
|
|
4409
|
+
if (this.childrenLoaders.get(route)) {
|
|
4410
|
+
return this.childrenLoaders.get(route);
|
|
4411
|
+
}
|
|
4412
|
+
else if (route._loadedRoutes) {
|
|
4413
|
+
return of({ routes: route._loadedRoutes, injector: route._loadedInjector });
|
|
4414
|
+
}
|
|
4415
|
+
if (this.onLoadStartListener) {
|
|
4416
|
+
this.onLoadStartListener(route);
|
|
4417
|
+
}
|
|
4418
|
+
const moduleFactoryOrRoutes$ = this.loadModuleFactoryOrRoutes(route.loadChildren);
|
|
4419
|
+
const loadRunner = moduleFactoryOrRoutes$.pipe(map((factoryOrRoutes) => {
|
|
4420
|
+
if (this.onLoadEndListener) {
|
|
4421
|
+
this.onLoadEndListener(route);
|
|
4422
|
+
}
|
|
4423
|
+
// This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is no
|
|
4424
|
+
// injector associated with lazy loading a `Route` array.
|
|
4425
|
+
let injector;
|
|
4426
|
+
let rawRoutes;
|
|
4427
|
+
let requireStandaloneComponents = false;
|
|
4428
|
+
if (Array.isArray(factoryOrRoutes)) {
|
|
4429
|
+
rawRoutes = factoryOrRoutes;
|
|
4430
|
+
requireStandaloneComponents = true;
|
|
4431
|
+
}
|
|
4432
|
+
else {
|
|
4433
|
+
injector = factoryOrRoutes.create(parentInjector).injector;
|
|
4434
|
+
// When loading a module that doesn't provide `RouterModule.forChild()` preloader
|
|
4435
|
+
// will get stuck in an infinite loop. The child module's Injector will look to
|
|
4436
|
+
// its parent `Injector` when it doesn't find any ROUTES so it will return routes
|
|
4437
|
+
// for it's parent module instead.
|
|
4438
|
+
rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
|
|
4439
|
+
}
|
|
4440
|
+
const routes = rawRoutes.map(standardizeConfig);
|
|
4441
|
+
NG_DEV_MODE$5 && validateConfig(routes, route.path, requireStandaloneComponents);
|
|
4442
|
+
return { routes, injector };
|
|
4443
|
+
}), finalize(() => {
|
|
4444
|
+
this.childrenLoaders.delete(route);
|
|
4445
|
+
}));
|
|
4446
|
+
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4447
|
+
const loader = new ConnectableObservable(loadRunner, () => new Subject())
|
|
4448
|
+
.pipe(refCount());
|
|
4449
|
+
this.childrenLoaders.set(route, loader);
|
|
4450
|
+
return loader;
|
|
4451
|
+
}
|
|
4452
|
+
loadModuleFactoryOrRoutes(loadChildren) {
|
|
4453
|
+
const deprecatedResult = deprecatedLoadChildrenString(this.injector, loadChildren);
|
|
4454
|
+
if (deprecatedResult) {
|
|
4455
|
+
return deprecatedResult;
|
|
4456
|
+
}
|
|
4457
|
+
return wrapIntoObservable(loadChildren())
|
|
4458
|
+
.pipe(map(maybeUnwrapDefaultExport), mergeMap((t) => {
|
|
4459
|
+
if (t instanceof NgModuleFactory || Array.isArray(t)) {
|
|
4460
|
+
return of(t);
|
|
4461
|
+
}
|
|
4462
|
+
else {
|
|
4463
|
+
return from(this.compiler.compileModuleAsync(t));
|
|
4464
|
+
}
|
|
4465
|
+
}));
|
|
4466
|
+
}
|
|
4467
|
+
}
|
|
4468
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4469
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4471
|
+
type: Injectable,
|
|
4472
|
+
args: [{ providedIn: 'root' }]
|
|
4473
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4474
|
+
function isWrappedDefaultExport(value) {
|
|
4475
|
+
// We use `in` here with a string key `'default'`, because we expect `DefaultExport` objects to be
|
|
4476
|
+
// dynamically imported ES modules with a spec-mandated `default` key. Thus we don't expect that
|
|
4477
|
+
// `default` will be a renamed property.
|
|
4478
|
+
return value && typeof value === 'object' && 'default' in value;
|
|
4479
|
+
}
|
|
4480
|
+
function maybeUnwrapDefaultExport(input) {
|
|
4481
|
+
// As per `isWrappedDefaultExport`, the `default` key here is generated by the browser and not
|
|
4482
|
+
// subject to property renaming, so we reference it with bracket access.
|
|
4483
|
+
return isWrappedDefaultExport(input) ? input['default'] : input;
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
/**
|
|
4487
|
+
* @license
|
|
4488
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4489
|
+
*
|
|
4490
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4491
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4492
|
+
*/
|
|
4493
|
+
const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4351
4494
|
class NavigationTransitions {
|
|
4352
|
-
constructor(
|
|
4353
|
-
this.router = router;
|
|
4495
|
+
constructor() {
|
|
4354
4496
|
this.currentNavigation = null;
|
|
4497
|
+
this.lastSuccessfulNavigation = null;
|
|
4498
|
+
this.events = new Subject();
|
|
4499
|
+
this.configLoader = inject(RouterConfigLoader);
|
|
4500
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
4501
|
+
this.urlSerializer = inject(UrlSerializer);
|
|
4502
|
+
this.rootContexts = inject(ChildrenOutletContexts);
|
|
4503
|
+
this.navigationId = 0;
|
|
4504
|
+
const onLoadStart = (r) => this.events.next(new RouteConfigLoadStart(r));
|
|
4505
|
+
const onLoadEnd = (r) => this.events.next(new RouteConfigLoadEnd(r));
|
|
4506
|
+
this.configLoader.onLoadEndListener = onLoadEnd;
|
|
4507
|
+
this.configLoader.onLoadStartListener = onLoadStart;
|
|
4508
|
+
}
|
|
4509
|
+
get hasRequestedNavigation() {
|
|
4510
|
+
return this.navigationId !== 0;
|
|
4511
|
+
}
|
|
4512
|
+
complete() {
|
|
4513
|
+
var _a;
|
|
4514
|
+
(_a = this.transitions) === null || _a === void 0 ? void 0 : _a.complete();
|
|
4355
4515
|
}
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4516
|
+
handleNavigationRequest(request) {
|
|
4517
|
+
var _a;
|
|
4518
|
+
const id = ++this.navigationId;
|
|
4519
|
+
(_a = this.transitions) === null || _a === void 0 ? void 0 : _a.next(Object.assign(Object.assign(Object.assign({}, this.transitions.value), request), { id }));
|
|
4520
|
+
}
|
|
4521
|
+
setupNavigations(router) {
|
|
4522
|
+
this.transitions = new BehaviorSubject({
|
|
4523
|
+
id: 0,
|
|
4524
|
+
targetPageId: 0,
|
|
4525
|
+
currentUrlTree: router.currentUrlTree,
|
|
4526
|
+
currentRawUrl: router.currentUrlTree,
|
|
4527
|
+
extractedUrl: router.urlHandlingStrategy.extract(router.currentUrlTree),
|
|
4528
|
+
urlAfterRedirects: router.urlHandlingStrategy.extract(router.currentUrlTree),
|
|
4529
|
+
rawUrl: router.currentUrlTree,
|
|
4530
|
+
extras: {},
|
|
4531
|
+
resolve: null,
|
|
4532
|
+
reject: null,
|
|
4533
|
+
promise: Promise.resolve(true),
|
|
4534
|
+
source: 'imperative',
|
|
4535
|
+
restoredState: null,
|
|
4536
|
+
currentSnapshot: router.routerState.snapshot,
|
|
4537
|
+
targetSnapshot: null,
|
|
4538
|
+
currentRouterState: router.routerState,
|
|
4539
|
+
targetRouterState: null,
|
|
4540
|
+
guards: { canActivateChecks: [], canDeactivateChecks: [] },
|
|
4541
|
+
guardsResult: null,
|
|
4542
|
+
});
|
|
4543
|
+
return this.transitions.pipe(filter(t => t.id !== 0),
|
|
4359
4544
|
// Extract URL
|
|
4360
|
-
map(t => (Object.assign(Object.assign({}, t), { extractedUrl:
|
|
4545
|
+
map(t => (Object.assign(Object.assign({}, t), { extractedUrl: router.urlHandlingStrategy.extract(t.rawUrl) }))),
|
|
4361
4546
|
// Using switchMap so we cancel executing navigations when a new one comes in
|
|
4362
4547
|
switchMap(overallTransitionState => {
|
|
4363
4548
|
let completed = false;
|
|
@@ -4372,38 +4557,41 @@ class NavigationTransitions {
|
|
|
4372
4557
|
extractedUrl: t.extractedUrl,
|
|
4373
4558
|
trigger: t.source,
|
|
4374
4559
|
extras: t.extras,
|
|
4375
|
-
previousNavigation: !this.
|
|
4560
|
+
previousNavigation: !this.lastSuccessfulNavigation ? null : Object.assign(Object.assign({}, this.lastSuccessfulNavigation), { previousNavigation: null }),
|
|
4376
4561
|
};
|
|
4377
4562
|
}), switchMap(t => {
|
|
4378
|
-
|
|
4379
|
-
const
|
|
4563
|
+
var _a;
|
|
4564
|
+
const browserUrlTree = router.browserUrlTree.toString();
|
|
4565
|
+
const urlTransition = !router.navigated ||
|
|
4380
4566
|
t.extractedUrl.toString() !== browserUrlTree ||
|
|
4381
4567
|
// Navigations which succeed or ones which fail and are cleaned up
|
|
4382
4568
|
// correctly should result in `browserUrlTree` and `currentUrlTree`
|
|
4383
4569
|
// matching. If this is not the case, assume something went wrong and
|
|
4384
4570
|
// try processing the URL again.
|
|
4385
|
-
browserUrlTree !==
|
|
4386
|
-
|
|
4387
|
-
|
|
4571
|
+
browserUrlTree !== router.currentUrlTree.toString();
|
|
4572
|
+
const onSameUrlNavigation = (_a = t.extras.onSameUrlNavigation) !== null && _a !== void 0 ? _a : router.onSameUrlNavigation;
|
|
4573
|
+
if (!urlTransition && onSameUrlNavigation !== 'reload') {
|
|
4574
|
+
const reason = NG_DEV_MODE$4 ?
|
|
4388
4575
|
`Navigation to ${t.rawUrl} was ignored because it is the same as the current Router URL.` :
|
|
4389
4576
|
'';
|
|
4390
|
-
this.
|
|
4391
|
-
|
|
4577
|
+
this.events.next(new NavigationSkipped(t.id, router.serializeUrl(overallTransitionState.rawUrl), reason, 0 /* NavigationSkippedCode.IgnoredSameUrlNavigation */));
|
|
4578
|
+
router.rawUrlTree = t.rawUrl;
|
|
4392
4579
|
t.resolve(null);
|
|
4393
4580
|
return EMPTY;
|
|
4394
4581
|
}
|
|
4395
|
-
if (
|
|
4582
|
+
if (router.urlHandlingStrategy.shouldProcessUrl(t.rawUrl)) {
|
|
4396
4583
|
// If the source of the navigation is from a browser event, the URL is
|
|
4397
4584
|
// already updated. We already need to sync the internal state.
|
|
4398
4585
|
if (isBrowserTriggeredNavigation(t.source)) {
|
|
4399
|
-
|
|
4586
|
+
router.browserUrlTree = t.extractedUrl;
|
|
4400
4587
|
}
|
|
4401
4588
|
return of(t).pipe(
|
|
4402
4589
|
// Fire NavigationStart event
|
|
4403
4590
|
switchMap(t => {
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4591
|
+
var _a, _b;
|
|
4592
|
+
const transition = (_a = this.transitions) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
4593
|
+
this.events.next(new NavigationStart(t.id, this.urlSerializer.serialize(t.extractedUrl), t.source, t.restoredState));
|
|
4594
|
+
if (transition !== ((_b = this.transitions) === null || _b === void 0 ? void 0 : _b.getValue())) {
|
|
4407
4595
|
return EMPTY;
|
|
4408
4596
|
}
|
|
4409
4597
|
// This delay is required to match old behavior that forced
|
|
@@ -4411,7 +4599,7 @@ class NavigationTransitions {
|
|
|
4411
4599
|
return Promise.resolve(t);
|
|
4412
4600
|
}),
|
|
4413
4601
|
// ApplyRedirects
|
|
4414
|
-
applyRedirects(this.
|
|
4602
|
+
applyRedirects(this.environmentInjector, this.configLoader, this.urlSerializer, router.config),
|
|
4415
4603
|
// Update the currentNavigation
|
|
4416
4604
|
// `urlAfterRedirects` is guaranteed to be set after this point
|
|
4417
4605
|
tap(t => {
|
|
@@ -4419,32 +4607,31 @@ class NavigationTransitions {
|
|
|
4419
4607
|
overallTransitionState.urlAfterRedirects = t.urlAfterRedirects;
|
|
4420
4608
|
}),
|
|
4421
4609
|
// Recognize
|
|
4422
|
-
recognize(this.
|
|
4610
|
+
recognize(this.environmentInjector, router.rootComponentType, router.config, this.urlSerializer, router.paramsInheritanceStrategy),
|
|
4423
4611
|
// Update URL if in `eager` update mode
|
|
4424
4612
|
tap(t => {
|
|
4425
4613
|
overallTransitionState.targetSnapshot = t.targetSnapshot;
|
|
4426
|
-
if (
|
|
4614
|
+
if (router.urlUpdateStrategy === 'eager') {
|
|
4427
4615
|
if (!t.extras.skipLocationChange) {
|
|
4428
|
-
const rawUrl =
|
|
4429
|
-
|
|
4616
|
+
const rawUrl = router.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4617
|
+
router.setBrowserUrl(rawUrl, t);
|
|
4430
4618
|
}
|
|
4431
|
-
|
|
4619
|
+
router.browserUrlTree = t.urlAfterRedirects;
|
|
4432
4620
|
}
|
|
4433
4621
|
// Fire RoutesRecognized
|
|
4434
|
-
const routesRecognized = new RoutesRecognized(t.id, this.
|
|
4435
|
-
|
|
4622
|
+
const routesRecognized = new RoutesRecognized(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4623
|
+
this.events.next(routesRecognized);
|
|
4436
4624
|
}));
|
|
4437
4625
|
}
|
|
4438
4626
|
else if (urlTransition &&
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4627
|
+
router.urlHandlingStrategy.shouldProcessUrl(router.rawUrlTree)) {
|
|
4628
|
+
/* When the current URL shouldn't be processed, but the previous one
|
|
4629
|
+
* was, we handle this "error condition" by navigating to the
|
|
4630
|
+
* previously successful URL, but leaving the URL intact.*/
|
|
4443
4631
|
const { id, extractedUrl, source, restoredState, extras } = t;
|
|
4444
|
-
const navStart = new NavigationStart(id, this.
|
|
4445
|
-
|
|
4446
|
-
const targetSnapshot = createEmptyState(extractedUrl,
|
|
4447
|
-
.snapshot;
|
|
4632
|
+
const navStart = new NavigationStart(id, this.urlSerializer.serialize(extractedUrl), source, restoredState);
|
|
4633
|
+
this.events.next(navStart);
|
|
4634
|
+
const targetSnapshot = createEmptyState(extractedUrl, router.rootComponentType).snapshot;
|
|
4448
4635
|
overallTransitionState = Object.assign(Object.assign({}, t), { targetSnapshot, urlAfterRedirects: extractedUrl, extras: Object.assign(Object.assign({}, extras), { skipLocationChange: false, replaceUrl: false }) });
|
|
4449
4636
|
return of(overallTransitionState);
|
|
4450
4637
|
}
|
|
@@ -4454,34 +4641,34 @@ class NavigationTransitions {
|
|
|
4454
4641
|
* current "settled" URL. This way the next navigation will be coming
|
|
4455
4642
|
* from the current URL in the browser.
|
|
4456
4643
|
*/
|
|
4457
|
-
const reason = NG_DEV_MODE$
|
|
4644
|
+
const reason = NG_DEV_MODE$4 ?
|
|
4458
4645
|
`Navigation was ignored because the UrlHandlingStrategy` +
|
|
4459
|
-
` indicated neither the current URL ${
|
|
4646
|
+
` indicated neither the current URL ${router.rawUrlTree} nor target URL ${t.rawUrl} should be processed.` :
|
|
4460
4647
|
'';
|
|
4461
|
-
this.
|
|
4462
|
-
|
|
4648
|
+
this.events.next(new NavigationSkipped(t.id, router.serializeUrl(overallTransitionState.extractedUrl), reason, 1 /* NavigationSkippedCode.IgnoredByUrlHandlingStrategy */));
|
|
4649
|
+
router.rawUrlTree = t.rawUrl;
|
|
4463
4650
|
t.resolve(null);
|
|
4464
4651
|
return EMPTY;
|
|
4465
4652
|
}
|
|
4466
4653
|
}),
|
|
4467
4654
|
// --- GUARDS ---
|
|
4468
4655
|
tap(t => {
|
|
4469
|
-
const guardsStart = new GuardsCheckStart(t.id, this.
|
|
4470
|
-
this.
|
|
4656
|
+
const guardsStart = new GuardsCheckStart(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4657
|
+
this.events.next(guardsStart);
|
|
4471
4658
|
}), map(t => {
|
|
4472
|
-
overallTransitionState = Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.
|
|
4659
|
+
overallTransitionState = Object.assign(Object.assign({}, t), { guards: getAllRouteGuards(t.targetSnapshot, t.currentSnapshot, this.rootContexts) });
|
|
4473
4660
|
return overallTransitionState;
|
|
4474
|
-
}), checkGuards(this.
|
|
4661
|
+
}), checkGuards(this.environmentInjector, (evt) => this.events.next(evt)), tap(t => {
|
|
4475
4662
|
overallTransitionState.guardsResult = t.guardsResult;
|
|
4476
4663
|
if (isUrlTree(t.guardsResult)) {
|
|
4477
|
-
throw redirectingNavigationError(this.
|
|
4664
|
+
throw redirectingNavigationError(this.urlSerializer, t.guardsResult);
|
|
4478
4665
|
}
|
|
4479
|
-
const guardsEnd = new GuardsCheckEnd(t.id, this.
|
|
4480
|
-
this.
|
|
4666
|
+
const guardsEnd = new GuardsCheckEnd(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot, !!t.guardsResult);
|
|
4667
|
+
this.events.next(guardsEnd);
|
|
4481
4668
|
}), filter(t => {
|
|
4482
4669
|
if (!t.guardsResult) {
|
|
4483
|
-
|
|
4484
|
-
this.
|
|
4670
|
+
router.restoreHistory(t);
|
|
4671
|
+
this.cancelNavigationTransition(t, '', 3 /* NavigationCancellationCode.GuardRejected */, router);
|
|
4485
4672
|
return false;
|
|
4486
4673
|
}
|
|
4487
4674
|
return true;
|
|
@@ -4490,24 +4677,24 @@ class NavigationTransitions {
|
|
|
4490
4677
|
switchTap(t => {
|
|
4491
4678
|
if (t.guards.canActivateChecks.length) {
|
|
4492
4679
|
return of(t).pipe(tap(t => {
|
|
4493
|
-
const resolveStart = new ResolveStart(t.id, this.
|
|
4494
|
-
this.
|
|
4680
|
+
const resolveStart = new ResolveStart(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4681
|
+
this.events.next(resolveStart);
|
|
4495
4682
|
}), switchMap(t => {
|
|
4496
4683
|
let dataResolved = false;
|
|
4497
|
-
return of(t).pipe(resolveData(
|
|
4684
|
+
return of(t).pipe(resolveData(router.paramsInheritanceStrategy, this.environmentInjector), tap({
|
|
4498
4685
|
next: () => dataResolved = true,
|
|
4499
4686
|
complete: () => {
|
|
4500
4687
|
if (!dataResolved) {
|
|
4501
|
-
|
|
4502
|
-
this.
|
|
4688
|
+
router.restoreHistory(t);
|
|
4689
|
+
this.cancelNavigationTransition(t, NG_DEV_MODE$4 ?
|
|
4503
4690
|
`At least one route resolver didn't emit any value.` :
|
|
4504
|
-
'', 2 /* NavigationCancellationCode.NoDataFromResolver
|
|
4691
|
+
'', 2 /* NavigationCancellationCode.NoDataFromResolver */, router);
|
|
4505
4692
|
}
|
|
4506
4693
|
}
|
|
4507
4694
|
}));
|
|
4508
4695
|
}), tap(t => {
|
|
4509
|
-
const resolveEnd = new ResolveEnd(t.id, this.
|
|
4510
|
-
this.
|
|
4696
|
+
const resolveEnd = new ResolveEnd(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects), t.targetSnapshot);
|
|
4697
|
+
this.events.next(resolveEnd);
|
|
4511
4698
|
}));
|
|
4512
4699
|
}
|
|
4513
4700
|
return undefined;
|
|
@@ -4519,7 +4706,7 @@ class NavigationTransitions {
|
|
|
4519
4706
|
const loaders = [];
|
|
4520
4707
|
if (((_a = route.routeConfig) === null || _a === void 0 ? void 0 : _a.loadComponent) &&
|
|
4521
4708
|
!route.routeConfig._loadedComponent) {
|
|
4522
|
-
loaders.push(this.
|
|
4709
|
+
loaders.push(this.configLoader.loadComponent(route.routeConfig)
|
|
4523
4710
|
.pipe(tap(loadedComponent => {
|
|
4524
4711
|
route.component = loadedComponent;
|
|
4525
4712
|
}), map(() => void 0)));
|
|
@@ -4531,8 +4718,8 @@ class NavigationTransitions {
|
|
|
4531
4718
|
};
|
|
4532
4719
|
return combineLatest(loadComponents(t.targetSnapshot.root))
|
|
4533
4720
|
.pipe(defaultIfEmpty(), take(1));
|
|
4534
|
-
}), switchTap(() =>
|
|
4535
|
-
const targetRouterState = createRouterState(
|
|
4721
|
+
}), switchTap(() => router.afterPreactivation()), map((t) => {
|
|
4722
|
+
const targetRouterState = createRouterState(router.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4536
4723
|
overallTransitionState = Object.assign(Object.assign({}, t), { targetRouterState });
|
|
4537
4724
|
return (overallTransitionState);
|
|
4538
4725
|
}),
|
|
@@ -4542,21 +4729,28 @@ class NavigationTransitions {
|
|
|
4542
4729
|
the current URL and the RouterState, as well as updated the browser URL.
|
|
4543
4730
|
All this should happen *before* activating. */
|
|
4544
4731
|
tap((t) => {
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4732
|
+
router.currentUrlTree = t.urlAfterRedirects;
|
|
4733
|
+
router.rawUrlTree =
|
|
4734
|
+
router.urlHandlingStrategy.merge(t.urlAfterRedirects, t.rawUrl);
|
|
4735
|
+
router.routerState =
|
|
4548
4736
|
t.targetRouterState;
|
|
4549
|
-
if (
|
|
4737
|
+
if (router.urlUpdateStrategy === 'deferred') {
|
|
4550
4738
|
if (!t.extras.skipLocationChange) {
|
|
4551
|
-
|
|
4739
|
+
router.setBrowserUrl(router.rawUrlTree, t);
|
|
4552
4740
|
}
|
|
4553
|
-
|
|
4741
|
+
router.browserUrlTree = t.urlAfterRedirects;
|
|
4554
4742
|
}
|
|
4555
|
-
}), activateRoutes(this.
|
|
4556
|
-
next() {
|
|
4743
|
+
}), activateRoutes(this.rootContexts, router.routeReuseStrategy, (evt) => this.events.next(evt)), tap({
|
|
4744
|
+
next: (t) => {
|
|
4745
|
+
var _a;
|
|
4557
4746
|
completed = true;
|
|
4747
|
+
this.lastSuccessfulNavigation = this.currentNavigation;
|
|
4748
|
+
router.navigated = true;
|
|
4749
|
+
this.events.next(new NavigationEnd(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(router.currentUrlTree)));
|
|
4750
|
+
(_a = router.titleStrategy) === null || _a === void 0 ? void 0 : _a.updateTitle(t.targetRouterState.snapshot);
|
|
4751
|
+
t.resolve(true);
|
|
4558
4752
|
},
|
|
4559
|
-
complete() {
|
|
4753
|
+
complete: () => {
|
|
4560
4754
|
completed = true;
|
|
4561
4755
|
}
|
|
4562
4756
|
}), finalize(() => {
|
|
@@ -4568,11 +4762,11 @@ class NavigationTransitions {
|
|
|
4568
4762
|
* catch-all to make sure the NavigationCancel event is fired when a
|
|
4569
4763
|
* navigation gets cancelled but not caught by other means. */
|
|
4570
4764
|
if (!completed && !errored) {
|
|
4571
|
-
const cancelationReason = NG_DEV_MODE$
|
|
4765
|
+
const cancelationReason = NG_DEV_MODE$4 ?
|
|
4572
4766
|
`Navigation ID ${overallTransitionState
|
|
4573
|
-
.id} is not equal to the current navigation id ${this.
|
|
4767
|
+
.id} is not equal to the current navigation id ${this.navigationId}` :
|
|
4574
4768
|
'';
|
|
4575
|
-
this.
|
|
4769
|
+
this.cancelNavigationTransition(overallTransitionState, cancelationReason, 1 /* NavigationCancellationCode.SupersededByNewNavigation */, router);
|
|
4576
4770
|
}
|
|
4577
4771
|
// Only clear current navigation if it is still set to the one that
|
|
4578
4772
|
// finalized.
|
|
@@ -4592,28 +4786,28 @@ class NavigationTransitions {
|
|
|
4592
4786
|
// navigate. This is only applicable with initial navigation, so
|
|
4593
4787
|
// setting `navigated` only when not redirecting resolves this
|
|
4594
4788
|
// scenario.
|
|
4595
|
-
|
|
4596
|
-
|
|
4789
|
+
router.navigated = true;
|
|
4790
|
+
router.restoreHistory(overallTransitionState, true);
|
|
4597
4791
|
}
|
|
4598
|
-
const navCancel = new NavigationCancel(overallTransitionState.id, this.
|
|
4599
|
-
|
|
4792
|
+
const navCancel = new NavigationCancel(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e.message, e.cancellationCode);
|
|
4793
|
+
this.events.next(navCancel);
|
|
4600
4794
|
// When redirecting, we need to delay resolving the navigation
|
|
4601
4795
|
// promise and push it to the redirect navigation
|
|
4602
4796
|
if (!isRedirectingNavigationCancelingError$1(e)) {
|
|
4603
4797
|
overallTransitionState.resolve(false);
|
|
4604
4798
|
}
|
|
4605
4799
|
else {
|
|
4606
|
-
const mergedTree =
|
|
4800
|
+
const mergedTree = router.urlHandlingStrategy.merge(e.url, router.rawUrlTree);
|
|
4607
4801
|
const extras = {
|
|
4608
4802
|
skipLocationChange: overallTransitionState.extras.skipLocationChange,
|
|
4609
4803
|
// The URL is already updated at this point if we have 'eager' URL
|
|
4610
4804
|
// updates or if the navigation was triggered by the browser (back
|
|
4611
4805
|
// button, URL bar, etc). We want to replace that item in history
|
|
4612
4806
|
// if the navigation is rejected.
|
|
4613
|
-
replaceUrl:
|
|
4807
|
+
replaceUrl: router.urlUpdateStrategy === 'eager' ||
|
|
4614
4808
|
isBrowserTriggeredNavigation(overallTransitionState.source)
|
|
4615
4809
|
};
|
|
4616
|
-
|
|
4810
|
+
router.scheduleNavigation(mergedTree, 'imperative', null, extras, {
|
|
4617
4811
|
resolve: overallTransitionState.resolve,
|
|
4618
4812
|
reject: overallTransitionState.reject,
|
|
4619
4813
|
promise: overallTransitionState.promise
|
|
@@ -4623,11 +4817,11 @@ class NavigationTransitions {
|
|
|
4623
4817
|
* to the pre-error state. */
|
|
4624
4818
|
}
|
|
4625
4819
|
else {
|
|
4626
|
-
|
|
4627
|
-
const navError = new NavigationError(overallTransitionState.id, this.
|
|
4628
|
-
|
|
4820
|
+
router.restoreHistory(overallTransitionState, true);
|
|
4821
|
+
const navError = new NavigationError(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e, (_a = overallTransitionState.targetSnapshot) !== null && _a !== void 0 ? _a : undefined);
|
|
4822
|
+
this.events.next(navError);
|
|
4629
4823
|
try {
|
|
4630
|
-
overallTransitionState.resolve(
|
|
4824
|
+
overallTransitionState.resolve(router.errorHandler(e));
|
|
4631
4825
|
}
|
|
4632
4826
|
catch (ee) {
|
|
4633
4827
|
overallTransitionState.reject(ee);
|
|
@@ -4638,7 +4832,18 @@ class NavigationTransitions {
|
|
|
4638
4832
|
// TODO(jasonaden): remove cast once g3 is on updated TypeScript
|
|
4639
4833
|
}));
|
|
4640
4834
|
}
|
|
4835
|
+
cancelNavigationTransition(t, reason, code, router) {
|
|
4836
|
+
const navCancel = new NavigationCancel(t.id, this.urlSerializer.serialize(t.extractedUrl), reason, code);
|
|
4837
|
+
this.events.next(navCancel);
|
|
4838
|
+
t.resolve(false);
|
|
4839
|
+
}
|
|
4641
4840
|
}
|
|
4841
|
+
NavigationTransitions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4842
|
+
NavigationTransitions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NavigationTransitions, providedIn: 'root' });
|
|
4843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NavigationTransitions, decorators: [{
|
|
4844
|
+
type: Injectable,
|
|
4845
|
+
args: [{ providedIn: 'root' }]
|
|
4846
|
+
}], ctorParameters: function () { return []; } });
|
|
4642
4847
|
function isBrowserTriggeredNavigation(source) {
|
|
4643
4848
|
return source !== 'imperative';
|
|
4644
4849
|
}
|
|
@@ -4695,9 +4900,9 @@ class TitleStrategy {
|
|
|
4695
4900
|
return snapshot.data[RouteTitleKey];
|
|
4696
4901
|
}
|
|
4697
4902
|
}
|
|
4698
|
-
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4699
|
-
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4700
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4903
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4904
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4701
4906
|
type: Injectable,
|
|
4702
4907
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4703
4908
|
}] });
|
|
@@ -4721,9 +4926,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4721
4926
|
}
|
|
4722
4927
|
}
|
|
4723
4928
|
}
|
|
4724
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4725
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4929
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4930
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4727
4932
|
type: Injectable,
|
|
4728
4933
|
args: [{ providedIn: 'root' }]
|
|
4729
4934
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -4744,9 +4949,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.0",
|
|
|
4744
4949
|
*/
|
|
4745
4950
|
class RouteReuseStrategy {
|
|
4746
4951
|
}
|
|
4747
|
-
RouteReuseStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4748
|
-
RouteReuseStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4749
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4952
|
+
RouteReuseStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4953
|
+
RouteReuseStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) });
|
|
4954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouteReuseStrategy, decorators: [{
|
|
4750
4955
|
type: Injectable,
|
|
4751
4956
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
|
|
4752
4957
|
}] });
|
|
@@ -4798,9 +5003,9 @@ class BaseRouteReuseStrategy {
|
|
|
4798
5003
|
}
|
|
4799
5004
|
class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
4800
5005
|
}
|
|
4801
|
-
DefaultRouteReuseStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4802
|
-
DefaultRouteReuseStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4803
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5006
|
+
DefaultRouteReuseStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
5007
|
+
DefaultRouteReuseStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' });
|
|
5008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
|
|
4804
5009
|
type: Injectable,
|
|
4805
5010
|
args: [{ providedIn: 'root' }]
|
|
4806
5011
|
}] });
|
|
@@ -4812,158 +5017,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.0",
|
|
|
4812
5017
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4813
5018
|
* found in the LICENSE file at https://angular.io/license
|
|
4814
5019
|
*/
|
|
4815
|
-
const NG_DEV_MODE$
|
|
5020
|
+
const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4816
5021
|
/**
|
|
4817
5022
|
* A [DI token](guide/glossary/#di-token) for the router service.
|
|
4818
5023
|
*
|
|
4819
5024
|
* @publicApi
|
|
4820
5025
|
*/
|
|
4821
|
-
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$
|
|
5026
|
+
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$3 ? 'router config' : '', {
|
|
4822
5027
|
providedIn: 'root',
|
|
4823
5028
|
factory: () => ({}),
|
|
4824
5029
|
});
|
|
4825
5030
|
|
|
4826
|
-
/**
|
|
4827
|
-
* @license
|
|
4828
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4829
|
-
*
|
|
4830
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
4831
|
-
* found in the LICENSE file at https://angular.io/license
|
|
4832
|
-
*/
|
|
4833
|
-
function deprecatedLoadChildrenString(injector, loadChildren) {
|
|
4834
|
-
return null;
|
|
4835
|
-
}
|
|
4836
|
-
|
|
4837
|
-
/**
|
|
4838
|
-
* @license
|
|
4839
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4840
|
-
*
|
|
4841
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
4842
|
-
* found in the LICENSE file at https://angular.io/license
|
|
4843
|
-
*/
|
|
4844
|
-
const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4845
|
-
/**
|
|
4846
|
-
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4847
|
-
*
|
|
4848
|
-
* `ROUTES` is a low level API for router configuration via dependency injection.
|
|
4849
|
-
*
|
|
4850
|
-
* We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
|
|
4851
|
-
* `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.
|
|
4852
|
-
*
|
|
4853
|
-
* @publicApi
|
|
4854
|
-
*/
|
|
4855
|
-
const ROUTES = new InjectionToken('ROUTES');
|
|
4856
|
-
class RouterConfigLoader {
|
|
4857
|
-
constructor(injector, compiler) {
|
|
4858
|
-
this.injector = injector;
|
|
4859
|
-
this.compiler = compiler;
|
|
4860
|
-
this.componentLoaders = new WeakMap();
|
|
4861
|
-
this.childrenLoaders = new WeakMap();
|
|
4862
|
-
}
|
|
4863
|
-
loadComponent(route) {
|
|
4864
|
-
if (this.componentLoaders.get(route)) {
|
|
4865
|
-
return this.componentLoaders.get(route);
|
|
4866
|
-
}
|
|
4867
|
-
else if (route._loadedComponent) {
|
|
4868
|
-
return of(route._loadedComponent);
|
|
4869
|
-
}
|
|
4870
|
-
if (this.onLoadStartListener) {
|
|
4871
|
-
this.onLoadStartListener(route);
|
|
4872
|
-
}
|
|
4873
|
-
const loadRunner = wrapIntoObservable(route.loadComponent())
|
|
4874
|
-
.pipe(map(maybeUnwrapDefaultExport), tap(component => {
|
|
4875
|
-
var _a;
|
|
4876
|
-
if (this.onLoadEndListener) {
|
|
4877
|
-
this.onLoadEndListener(route);
|
|
4878
|
-
}
|
|
4879
|
-
NG_DEV_MODE$3 && assertStandalone((_a = route.path) !== null && _a !== void 0 ? _a : '', component);
|
|
4880
|
-
route._loadedComponent = component;
|
|
4881
|
-
}), finalize(() => {
|
|
4882
|
-
this.componentLoaders.delete(route);
|
|
4883
|
-
}));
|
|
4884
|
-
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4885
|
-
const loader = new ConnectableObservable(loadRunner, () => new Subject()).pipe(refCount());
|
|
4886
|
-
this.componentLoaders.set(route, loader);
|
|
4887
|
-
return loader;
|
|
4888
|
-
}
|
|
4889
|
-
loadChildren(parentInjector, route) {
|
|
4890
|
-
if (this.childrenLoaders.get(route)) {
|
|
4891
|
-
return this.childrenLoaders.get(route);
|
|
4892
|
-
}
|
|
4893
|
-
else if (route._loadedRoutes) {
|
|
4894
|
-
return of({ routes: route._loadedRoutes, injector: route._loadedInjector });
|
|
4895
|
-
}
|
|
4896
|
-
if (this.onLoadStartListener) {
|
|
4897
|
-
this.onLoadStartListener(route);
|
|
4898
|
-
}
|
|
4899
|
-
const moduleFactoryOrRoutes$ = this.loadModuleFactoryOrRoutes(route.loadChildren);
|
|
4900
|
-
const loadRunner = moduleFactoryOrRoutes$.pipe(map((factoryOrRoutes) => {
|
|
4901
|
-
if (this.onLoadEndListener) {
|
|
4902
|
-
this.onLoadEndListener(route);
|
|
4903
|
-
}
|
|
4904
|
-
// This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is no
|
|
4905
|
-
// injector associated with lazy loading a `Route` array.
|
|
4906
|
-
let injector;
|
|
4907
|
-
let rawRoutes;
|
|
4908
|
-
let requireStandaloneComponents = false;
|
|
4909
|
-
if (Array.isArray(factoryOrRoutes)) {
|
|
4910
|
-
rawRoutes = factoryOrRoutes;
|
|
4911
|
-
requireStandaloneComponents = true;
|
|
4912
|
-
}
|
|
4913
|
-
else {
|
|
4914
|
-
injector = factoryOrRoutes.create(parentInjector).injector;
|
|
4915
|
-
// When loading a module that doesn't provide `RouterModule.forChild()` preloader
|
|
4916
|
-
// will get stuck in an infinite loop. The child module's Injector will look to
|
|
4917
|
-
// its parent `Injector` when it doesn't find any ROUTES so it will return routes
|
|
4918
|
-
// for it's parent module instead.
|
|
4919
|
-
rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
|
|
4920
|
-
}
|
|
4921
|
-
const routes = rawRoutes.map(standardizeConfig);
|
|
4922
|
-
NG_DEV_MODE$3 && validateConfig(routes, route.path, requireStandaloneComponents);
|
|
4923
|
-
return { routes, injector };
|
|
4924
|
-
}), finalize(() => {
|
|
4925
|
-
this.childrenLoaders.delete(route);
|
|
4926
|
-
}));
|
|
4927
|
-
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4928
|
-
const loader = new ConnectableObservable(loadRunner, () => new Subject())
|
|
4929
|
-
.pipe(refCount());
|
|
4930
|
-
this.childrenLoaders.set(route, loader);
|
|
4931
|
-
return loader;
|
|
4932
|
-
}
|
|
4933
|
-
loadModuleFactoryOrRoutes(loadChildren) {
|
|
4934
|
-
const deprecatedResult = deprecatedLoadChildrenString(this.injector, loadChildren);
|
|
4935
|
-
if (deprecatedResult) {
|
|
4936
|
-
return deprecatedResult;
|
|
4937
|
-
}
|
|
4938
|
-
return wrapIntoObservable(loadChildren())
|
|
4939
|
-
.pipe(map(maybeUnwrapDefaultExport), mergeMap((t) => {
|
|
4940
|
-
if (t instanceof NgModuleFactory || Array.isArray(t)) {
|
|
4941
|
-
return of(t);
|
|
4942
|
-
}
|
|
4943
|
-
else {
|
|
4944
|
-
return from(this.compiler.compileModuleAsync(t));
|
|
4945
|
-
}
|
|
4946
|
-
}));
|
|
4947
|
-
}
|
|
4948
|
-
}
|
|
4949
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4950
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4952
|
-
type: Injectable,
|
|
4953
|
-
args: [{ providedIn: 'root' }]
|
|
4954
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4955
|
-
function isWrappedDefaultExport(value) {
|
|
4956
|
-
// We use `in` here with a string key `'default'`, because we expect `DefaultExport` objects to be
|
|
4957
|
-
// dynamically imported ES modules with a spec-mandated `default` key. Thus we don't expect that
|
|
4958
|
-
// `default` will be a renamed property.
|
|
4959
|
-
return value && typeof value === 'object' && 'default' in value;
|
|
4960
|
-
}
|
|
4961
|
-
function maybeUnwrapDefaultExport(input) {
|
|
4962
|
-
// As per `isWrappedDefaultExport`, the `default` key here is generated by the browser and not
|
|
4963
|
-
// subject to property renaming, so we reference it with bracket access.
|
|
4964
|
-
return isWrappedDefaultExport(input) ? input['default'] : input;
|
|
4965
|
-
}
|
|
4966
|
-
|
|
4967
5031
|
/**
|
|
4968
5032
|
* @license
|
|
4969
5033
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4980,9 +5044,9 @@ function maybeUnwrapDefaultExport(input) {
|
|
|
4980
5044
|
*/
|
|
4981
5045
|
class UrlHandlingStrategy {
|
|
4982
5046
|
}
|
|
4983
|
-
UrlHandlingStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4984
|
-
UrlHandlingStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
4985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5047
|
+
UrlHandlingStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5048
|
+
UrlHandlingStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) });
|
|
5049
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
|
|
4986
5050
|
type: Injectable,
|
|
4987
5051
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
|
|
4988
5052
|
}] });
|
|
@@ -5000,9 +5064,9 @@ class DefaultUrlHandlingStrategy {
|
|
|
5000
5064
|
return newUrlPart;
|
|
5001
5065
|
}
|
|
5002
5066
|
}
|
|
5003
|
-
DefaultUrlHandlingStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5004
|
-
DefaultUrlHandlingStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5067
|
+
DefaultUrlHandlingStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5068
|
+
DefaultUrlHandlingStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' });
|
|
5069
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
|
|
5006
5070
|
type: Injectable,
|
|
5007
5071
|
args: [{ providedIn: 'root' }]
|
|
5008
5072
|
}] });
|
|
@@ -5093,23 +5157,13 @@ class Router {
|
|
|
5093
5157
|
// TODO: vsavkin make internal after the final is out.
|
|
5094
5158
|
constructor(
|
|
5095
5159
|
/** @internal */
|
|
5096
|
-
rootComponentType,
|
|
5097
|
-
/** @internal */
|
|
5098
|
-
urlSerializer,
|
|
5099
|
-
/** @internal */
|
|
5100
|
-
rootContexts,
|
|
5101
|
-
/** @internal */
|
|
5102
|
-
location, injector, compiler, config) {
|
|
5160
|
+
rootComponentType, urlSerializer, rootContexts, location, injector, compiler, config) {
|
|
5103
5161
|
this.rootComponentType = rootComponentType;
|
|
5104
5162
|
this.urlSerializer = urlSerializer;
|
|
5105
5163
|
this.rootContexts = rootContexts;
|
|
5106
5164
|
this.location = location;
|
|
5107
5165
|
this.config = config;
|
|
5108
|
-
/** @internal */
|
|
5109
|
-
this.lastSuccessfulNavigation = null;
|
|
5110
5166
|
this.disposed = false;
|
|
5111
|
-
/** @internal */
|
|
5112
|
-
this.navigationId = 0;
|
|
5113
5167
|
/**
|
|
5114
5168
|
* The id of the currently active page in the router.
|
|
5115
5169
|
* Updated to the transition's target id on a successful navigation.
|
|
@@ -5120,10 +5174,6 @@ class Router {
|
|
|
5120
5174
|
*/
|
|
5121
5175
|
this.currentPageId = 0;
|
|
5122
5176
|
this.isNgZoneEnabled = false;
|
|
5123
|
-
/**
|
|
5124
|
-
* An event stream for routing events in this NgModule.
|
|
5125
|
-
*/
|
|
5126
|
-
this.events = new Subject();
|
|
5127
5177
|
/**
|
|
5128
5178
|
* A handler for navigation errors in this NgModule.
|
|
5129
5179
|
*
|
|
@@ -5177,17 +5227,8 @@ class Router {
|
|
|
5177
5227
|
*/
|
|
5178
5228
|
this.titleStrategy = inject(TitleStrategy);
|
|
5179
5229
|
/**
|
|
5180
|
-
* How to handle a navigation request to the current URL.
|
|
5181
|
-
*
|
|
5182
|
-
* - `'ignore'` : The router ignores the request.
|
|
5183
|
-
* - `'reload'` : The router reloads the URL. Use to implement a "refresh" feature.
|
|
5230
|
+
* How to handle a navigation request to the current URL.
|
|
5184
5231
|
*
|
|
5185
|
-
* Note that this only configures whether the Route reprocesses the URL and triggers related
|
|
5186
|
-
* action and events like redirects, guards, and resolvers. By default, the router re-uses a
|
|
5187
|
-
* component instance when it re-navigates to the same component type without visiting a different
|
|
5188
|
-
* component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload
|
|
5189
|
-
* routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`
|
|
5190
|
-
* _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.
|
|
5191
5232
|
*
|
|
5192
5233
|
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
5193
5234
|
* @see `withRouterConfig`
|
|
@@ -5250,13 +5291,7 @@ class Router {
|
|
|
5250
5291
|
* @see `RouterModule`
|
|
5251
5292
|
*/
|
|
5252
5293
|
this.canceledNavigationResolution = 'replace';
|
|
5253
|
-
this.navigationTransitions =
|
|
5254
|
-
const onLoadStart = (r) => this.triggerEvent(new RouteConfigLoadStart(r));
|
|
5255
|
-
const onLoadEnd = (r) => this.triggerEvent(new RouteConfigLoadEnd(r));
|
|
5256
|
-
this.configLoader = injector.get(RouterConfigLoader);
|
|
5257
|
-
this.configLoader.onLoadEndListener = onLoadEnd;
|
|
5258
|
-
this.configLoader.onLoadStartListener = onLoadStart;
|
|
5259
|
-
this.ngModule = injector.get(NgModuleRef);
|
|
5294
|
+
this.navigationTransitions = inject(NavigationTransitions);
|
|
5260
5295
|
this.console = injector.get(ɵConsole);
|
|
5261
5296
|
const ngZone = injector.get(NgZone);
|
|
5262
5297
|
this.isNgZoneEnabled = ngZone instanceof NgZone && NgZone.isInAngularZone();
|
|
@@ -5265,28 +5300,17 @@ class Router {
|
|
|
5265
5300
|
this.rawUrlTree = this.currentUrlTree;
|
|
5266
5301
|
this.browserUrlTree = this.currentUrlTree;
|
|
5267
5302
|
this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
|
|
5268
|
-
this.
|
|
5269
|
-
id
|
|
5270
|
-
targetPageId
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
urlAfterRedirects: this.urlHandlingStrategy.extract(this.currentUrlTree),
|
|
5274
|
-
rawUrl: this.currentUrlTree,
|
|
5275
|
-
extras: {},
|
|
5276
|
-
resolve: null,
|
|
5277
|
-
reject: null,
|
|
5278
|
-
promise: Promise.resolve(true),
|
|
5279
|
-
source: 'imperative',
|
|
5280
|
-
restoredState: null,
|
|
5281
|
-
currentSnapshot: this.routerState.snapshot,
|
|
5282
|
-
targetSnapshot: null,
|
|
5283
|
-
currentRouterState: this.routerState,
|
|
5284
|
-
targetRouterState: null,
|
|
5285
|
-
guards: { canActivateChecks: [], canDeactivateChecks: [] },
|
|
5286
|
-
guardsResult: null,
|
|
5303
|
+
this.navigationTransitions.setupNavigations(this).subscribe(t => {
|
|
5304
|
+
this.lastSuccessfulId = t.id;
|
|
5305
|
+
this.currentPageId = t.targetPageId;
|
|
5306
|
+
}, e => {
|
|
5307
|
+
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
5287
5308
|
});
|
|
5288
|
-
|
|
5289
|
-
|
|
5309
|
+
}
|
|
5310
|
+
// TODO(b/260747083): This should not exist and navigationId should be private in
|
|
5311
|
+
// `NavigationTransitions`
|
|
5312
|
+
get navigationId() {
|
|
5313
|
+
return this.navigationTransitions.navigationId;
|
|
5290
5314
|
}
|
|
5291
5315
|
/**
|
|
5292
5316
|
* The ɵrouterPageId of whatever page is currently active in the browser history. This is
|
|
@@ -5297,6 +5321,16 @@ class Router {
|
|
|
5297
5321
|
var _a;
|
|
5298
5322
|
return (_a = this.location.getState()) === null || _a === void 0 ? void 0 : _a.ɵrouterPageId;
|
|
5299
5323
|
}
|
|
5324
|
+
/**
|
|
5325
|
+
* An event stream for routing events.
|
|
5326
|
+
*/
|
|
5327
|
+
get events() {
|
|
5328
|
+
// TODO(atscott): This _should_ be events.asObservable(). However, this change requires internal
|
|
5329
|
+
// cleanup: tests are doing `(route.events as Subject<Event>).next(...)`. This isn't
|
|
5330
|
+
// allowed/supported but we still have to fix these or file bugs against the teams before making
|
|
5331
|
+
// the change.
|
|
5332
|
+
return this.navigationTransitions.events;
|
|
5333
|
+
}
|
|
5300
5334
|
/**
|
|
5301
5335
|
* @internal
|
|
5302
5336
|
* TODO: this should be removed once the constructor of the router made internal
|
|
@@ -5307,15 +5341,12 @@ class Router {
|
|
|
5307
5341
|
// this will simplify the lifecycle of the router.
|
|
5308
5342
|
this.routerState.root.component = this.rootComponentType;
|
|
5309
5343
|
}
|
|
5310
|
-
setTransition(t) {
|
|
5311
|
-
this.transitions.next(Object.assign(Object.assign({}, this.transitions.value), t));
|
|
5312
|
-
}
|
|
5313
5344
|
/**
|
|
5314
5345
|
* Sets up the location change listener and performs the initial navigation.
|
|
5315
5346
|
*/
|
|
5316
5347
|
initialNavigation() {
|
|
5317
5348
|
this.setUpLocationChangeListener();
|
|
5318
|
-
if (this.
|
|
5349
|
+
if (!this.navigationTransitions.hasRequestedNavigation) {
|
|
5319
5350
|
this.navigateByUrl(this.location.path(true), { replaceUrl: true });
|
|
5320
5351
|
}
|
|
5321
5352
|
}
|
|
@@ -5373,10 +5404,6 @@ class Router {
|
|
|
5373
5404
|
getCurrentNavigation() {
|
|
5374
5405
|
return this.navigationTransitions.currentNavigation;
|
|
5375
5406
|
}
|
|
5376
|
-
/** @internal */
|
|
5377
|
-
triggerEvent(event) {
|
|
5378
|
-
this.events.next(event);
|
|
5379
|
-
}
|
|
5380
5407
|
/**
|
|
5381
5408
|
* Resets the route configuration used for navigation and generating links.
|
|
5382
5409
|
*
|
|
@@ -5405,7 +5432,7 @@ class Router {
|
|
|
5405
5432
|
}
|
|
5406
5433
|
/** Disposes of the router. */
|
|
5407
5434
|
dispose() {
|
|
5408
|
-
this.
|
|
5435
|
+
this.navigationTransitions.complete();
|
|
5409
5436
|
if (this.locationSubscription) {
|
|
5410
5437
|
this.locationSubscription.unsubscribe();
|
|
5411
5438
|
this.locationSubscription = undefined;
|
|
@@ -5590,21 +5617,6 @@ class Router {
|
|
|
5590
5617
|
return result;
|
|
5591
5618
|
}, {});
|
|
5592
5619
|
}
|
|
5593
|
-
processNavigations() {
|
|
5594
|
-
this.navigations.subscribe(t => {
|
|
5595
|
-
var _a;
|
|
5596
|
-
this.navigated = true;
|
|
5597
|
-
this.lastSuccessfulId = t.id;
|
|
5598
|
-
this.currentPageId = t.targetPageId;
|
|
5599
|
-
this.events
|
|
5600
|
-
.next(new NavigationEnd(t.id, this.serializeUrl(t.extractedUrl), this.serializeUrl(this.currentUrlTree)));
|
|
5601
|
-
this.lastSuccessfulNavigation = this.getCurrentNavigation();
|
|
5602
|
-
(_a = this.titleStrategy) === null || _a === void 0 ? void 0 : _a.updateTitle(this.routerState.snapshot);
|
|
5603
|
-
t.resolve(true);
|
|
5604
|
-
}, e => {
|
|
5605
|
-
this.console.warn(`Unhandled Navigation Error: ${e}`);
|
|
5606
|
-
});
|
|
5607
|
-
}
|
|
5608
5620
|
/** @internal */
|
|
5609
5621
|
scheduleNavigation(rawUrl, source, restoredState, extras, priorPromise) {
|
|
5610
5622
|
var _a, _b;
|
|
@@ -5625,7 +5637,6 @@ class Router {
|
|
|
5625
5637
|
reject = rej;
|
|
5626
5638
|
});
|
|
5627
5639
|
}
|
|
5628
|
-
const id = ++this.navigationId;
|
|
5629
5640
|
let targetPageId;
|
|
5630
5641
|
if (this.canceledNavigationResolution === 'computed') {
|
|
5631
5642
|
const isInitialPage = this.currentPageId === 0;
|
|
@@ -5653,12 +5664,12 @@ class Router {
|
|
|
5653
5664
|
// This is unused when `canceledNavigationResolution` is not computed.
|
|
5654
5665
|
targetPageId = 0;
|
|
5655
5666
|
}
|
|
5656
|
-
this.
|
|
5657
|
-
id,
|
|
5667
|
+
this.navigationTransitions.handleNavigationRequest({
|
|
5658
5668
|
targetPageId,
|
|
5659
5669
|
source,
|
|
5660
5670
|
restoredState,
|
|
5661
5671
|
currentUrlTree: this.currentUrlTree,
|
|
5672
|
+
currentRawUrl: this.currentUrlTree,
|
|
5662
5673
|
rawUrl,
|
|
5663
5674
|
extras,
|
|
5664
5675
|
resolve,
|
|
@@ -5743,12 +5754,6 @@ class Router {
|
|
|
5743
5754
|
resetUrlToCurrentUrlTree() {
|
|
5744
5755
|
this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree), '', this.generateNgRouterState(this.lastSuccessfulId, this.currentPageId));
|
|
5745
5756
|
}
|
|
5746
|
-
/** @internal */
|
|
5747
|
-
cancelNavigationTransition(transition, reason, code) {
|
|
5748
|
-
const navCancel = new NavigationCancel(transition.id, this.serializeUrl(transition.extractedUrl), reason, code);
|
|
5749
|
-
this.triggerEvent(navCancel);
|
|
5750
|
-
transition.resolve(false);
|
|
5751
|
-
}
|
|
5752
5757
|
generateNgRouterState(navigationId, routerPageId) {
|
|
5753
5758
|
if (this.canceledNavigationResolution === 'computed') {
|
|
5754
5759
|
return { navigationId, ɵrouterPageId: routerPageId };
|
|
@@ -5756,9 +5761,9 @@ class Router {
|
|
|
5756
5761
|
return { navigationId };
|
|
5757
5762
|
}
|
|
5758
5763
|
}
|
|
5759
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5760
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
5764
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5765
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
|
|
5766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: Router, decorators: [{
|
|
5762
5767
|
type: Injectable,
|
|
5763
5768
|
args: [{
|
|
5764
5769
|
providedIn: 'root',
|
|
@@ -6049,9 +6054,9 @@ class RouterLink {
|
|
|
6049
6054
|
});
|
|
6050
6055
|
}
|
|
6051
6056
|
}
|
|
6052
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6053
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.
|
|
6054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6057
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", 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 });
|
|
6058
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.1", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", 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 });
|
|
6059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterLink, decorators: [{
|
|
6055
6060
|
type: Directive,
|
|
6056
6061
|
args: [{
|
|
6057
6062
|
selector: '[routerLink]',
|
|
@@ -6280,9 +6285,9 @@ class RouterLinkActive {
|
|
|
6280
6285
|
return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
|
|
6281
6286
|
}
|
|
6282
6287
|
}
|
|
6283
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6284
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.
|
|
6285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6288
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6289
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.0-next.1", 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 });
|
|
6290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
6286
6291
|
type: Directive,
|
|
6287
6292
|
args: [{
|
|
6288
6293
|
selector: '[routerLinkActive]',
|
|
@@ -6344,9 +6349,9 @@ class PreloadAllModules {
|
|
|
6344
6349
|
return fn().pipe(catchError(() => of(null)));
|
|
6345
6350
|
}
|
|
6346
6351
|
}
|
|
6347
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6348
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6352
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6353
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6350
6355
|
type: Injectable,
|
|
6351
6356
|
args: [{ providedIn: 'root' }]
|
|
6352
6357
|
}] });
|
|
@@ -6364,9 +6369,9 @@ class NoPreloading {
|
|
|
6364
6369
|
return of(null);
|
|
6365
6370
|
}
|
|
6366
6371
|
}
|
|
6367
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6368
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6372
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6373
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6370
6375
|
type: Injectable,
|
|
6371
6376
|
args: [{ providedIn: 'root' }]
|
|
6372
6377
|
}] });
|
|
@@ -6462,18 +6467,19 @@ class RouterPreloader {
|
|
|
6462
6467
|
});
|
|
6463
6468
|
}
|
|
6464
6469
|
}
|
|
6465
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6466
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6467
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6470
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6471
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
|
|
6472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6468
6473
|
type: Injectable,
|
|
6469
6474
|
args: [{ providedIn: 'root' }]
|
|
6470
6475
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6471
6476
|
|
|
6472
6477
|
const ROUTER_SCROLLER = new InjectionToken('');
|
|
6473
6478
|
class RouterScroller {
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
this.
|
|
6479
|
+
/** @nodoc */
|
|
6480
|
+
constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) {
|
|
6481
|
+
this.urlSerializer = urlSerializer;
|
|
6482
|
+
this.transitions = transitions;
|
|
6477
6483
|
this.viewportScroller = viewportScroller;
|
|
6478
6484
|
this.zone = zone;
|
|
6479
6485
|
this.options = options;
|
|
@@ -6496,7 +6502,7 @@ class RouterScroller {
|
|
|
6496
6502
|
this.scrollEventsSubscription = this.consumeScrollEvents();
|
|
6497
6503
|
}
|
|
6498
6504
|
createScrollEvents() {
|
|
6499
|
-
return this.
|
|
6505
|
+
return this.transitions.events.subscribe(e => {
|
|
6500
6506
|
if (e instanceof NavigationStart) {
|
|
6501
6507
|
// store the scroll position of the current stable navigations.
|
|
6502
6508
|
this.store[this.lastId] = this.viewportScroller.getScrollPosition();
|
|
@@ -6505,12 +6511,12 @@ class RouterScroller {
|
|
|
6505
6511
|
}
|
|
6506
6512
|
else if (e instanceof NavigationEnd) {
|
|
6507
6513
|
this.lastId = e.id;
|
|
6508
|
-
this.scheduleScrollEvent(e, this.
|
|
6514
|
+
this.scheduleScrollEvent(e, this.urlSerializer.parse(e.urlAfterRedirects).fragment);
|
|
6509
6515
|
}
|
|
6510
6516
|
});
|
|
6511
6517
|
}
|
|
6512
6518
|
consumeScrollEvents() {
|
|
6513
|
-
return this.
|
|
6519
|
+
return this.transitions.events.subscribe(e => {
|
|
6514
6520
|
if (!(e instanceof Scroll))
|
|
6515
6521
|
return;
|
|
6516
6522
|
// a popstate event. The pop state event will always ignore anchor scrolling.
|
|
@@ -6540,26 +6546,23 @@ class RouterScroller {
|
|
|
6540
6546
|
// component by executing its update block of the template function.
|
|
6541
6547
|
setTimeout(() => {
|
|
6542
6548
|
this.zone.run(() => {
|
|
6543
|
-
this.
|
|
6549
|
+
this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));
|
|
6544
6550
|
});
|
|
6545
6551
|
}, 0);
|
|
6546
6552
|
});
|
|
6547
6553
|
}
|
|
6548
6554
|
/** @nodoc */
|
|
6549
6555
|
ngOnDestroy() {
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
if (this.scrollEventsSubscription) {
|
|
6554
|
-
this.scrollEventsSubscription.unsubscribe();
|
|
6555
|
-
}
|
|
6556
|
+
var _a, _b;
|
|
6557
|
+
(_a = this.routerEventsSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
6558
|
+
(_b = this.scrollEventsSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
6556
6559
|
}
|
|
6557
6560
|
}
|
|
6558
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6559
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
6561
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6562
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterScroller });
|
|
6563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6561
6564
|
type: Injectable
|
|
6562
|
-
}], ctorParameters: function () { return [{ type:
|
|
6565
|
+
}], ctorParameters: function () { return [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }]; } });
|
|
6563
6566
|
|
|
6564
6567
|
/**
|
|
6565
6568
|
* @license
|
|
@@ -6696,10 +6699,11 @@ function withInMemoryScrolling(options = {}) {
|
|
|
6696
6699
|
const providers = [{
|
|
6697
6700
|
provide: ROUTER_SCROLLER,
|
|
6698
6701
|
useFactory: () => {
|
|
6699
|
-
const router = inject(Router);
|
|
6700
6702
|
const viewportScroller = inject(ViewportScroller);
|
|
6701
6703
|
const zone = inject(NgZone);
|
|
6702
|
-
|
|
6704
|
+
const transitions = inject(NavigationTransitions);
|
|
6705
|
+
const urlSerializer = inject(UrlSerializer);
|
|
6706
|
+
return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, options);
|
|
6703
6707
|
},
|
|
6704
6708
|
}];
|
|
6705
6709
|
return routerFeature(4 /* RouterFeatureKind.InMemoryScrollingFeature */, providers);
|
|
@@ -7101,10 +7105,10 @@ class RouterModule {
|
|
|
7101
7105
|
};
|
|
7102
7106
|
}
|
|
7103
7107
|
}
|
|
7104
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
7105
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0-next.
|
|
7106
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
7107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.
|
|
7108
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7109
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
7110
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
|
|
7111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.1", ngImport: i0, type: RouterModule, decorators: [{
|
|
7108
7112
|
type: NgModule,
|
|
7109
7113
|
args: [{
|
|
7110
7114
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -7126,14 +7130,15 @@ function provideRouterScroller() {
|
|
|
7126
7130
|
return {
|
|
7127
7131
|
provide: ROUTER_SCROLLER,
|
|
7128
7132
|
useFactory: () => {
|
|
7129
|
-
const router = inject(Router);
|
|
7130
7133
|
const viewportScroller = inject(ViewportScroller);
|
|
7131
7134
|
const zone = inject(NgZone);
|
|
7132
7135
|
const config = inject(ROUTER_CONFIGURATION);
|
|
7136
|
+
const transitions = inject(NavigationTransitions);
|
|
7137
|
+
const urlSerializer = inject(UrlSerializer);
|
|
7133
7138
|
if (config.scrollOffset) {
|
|
7134
7139
|
viewportScroller.setOffset(config.scrollOffset);
|
|
7135
7140
|
}
|
|
7136
|
-
return new RouterScroller(
|
|
7141
|
+
return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config);
|
|
7137
7142
|
},
|
|
7138
7143
|
};
|
|
7139
7144
|
}
|
|
@@ -7191,7 +7196,7 @@ function provideRouterInitializer() {
|
|
|
7191
7196
|
/**
|
|
7192
7197
|
* @publicApi
|
|
7193
7198
|
*/
|
|
7194
|
-
const VERSION = new Version('15.1.0-next.
|
|
7199
|
+
const VERSION = new Version('15.1.0-next.1');
|
|
7195
7200
|
|
|
7196
7201
|
/**
|
|
7197
7202
|
* @license
|