@angular/router 14.1.0-next.1 → 14.1.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/esm2020/src/apply_redirects.mjs +3 -4
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/directives/router_link.mjs +6 -6
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +3 -3
- package/esm2020/src/index.mjs +1 -1
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/page_title_strategy.mjs +3 -3
- package/esm2020/src/private_export.mjs +2 -2
- package/esm2020/src/recognize.mjs +4 -5
- package/esm2020/src/router.mjs +3 -3
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +151 -136
- package/esm2020/src/router_preloader.mjs +16 -4
- package/esm2020/src/router_scroller.mjs +6 -5
- package/esm2020/src/utils/config_matching.mjs +5 -2
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +8 -8
- package/fesm2015/router.mjs +213 -182
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +8 -8
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +208 -179
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +8 -8
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +20 -5
- package/package.json +4 -4
- package/testing/index.d.ts +2 -2
- package/upgrade/index.d.ts +1 -1
package/fesm2015/router.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0-next.
|
|
2
|
+
* @license Angular v14.1.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
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf,
|
|
8
|
+
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, InjectionToken, InjectFlags, NgModuleFactory, Injectable, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, Injector, Compiler, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Inject, ApplicationRef, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, combineLatest, concat, defer, pipe, throwError, EmptyError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import { map, switchMap, take, startWith, scan, filter, mergeMap, first, concatMap, tap, catchError, last as last$1, takeWhile, defaultIfEmpty, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
11
11
|
import * as i3 from '@angular/common';
|
|
12
|
-
import { Location, LocationStrategy,
|
|
12
|
+
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, ViewportScroller, LOCATION_INITIALIZED } from '@angular/common';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -2493,9 +2493,9 @@ class RouterOutlet {
|
|
|
2493
2493
|
this.activateEvents.emit(this.activated.instance);
|
|
2494
2494
|
}
|
|
2495
2495
|
}
|
|
2496
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2497
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
2498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2496
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2497
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.2", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2499
2499
|
type: Directive,
|
|
2500
2500
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2501
2501
|
}], ctorParameters: function () {
|
|
@@ -2554,9 +2554,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2554
2554
|
*/
|
|
2555
2555
|
class ɵEmptyOutletComponent {
|
|
2556
2556
|
}
|
|
2557
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2558
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
2559
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2557
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2558
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-next.2", type: ɵEmptyOutletComponent, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2560
2560
|
type: Component,
|
|
2561
2561
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2562
2562
|
}] });
|
|
@@ -3346,6 +3346,9 @@ function matchWithChecks(segmentGroup, route, segments, injector, urlSerializer)
|
|
|
3346
3346
|
if (!result.matched) {
|
|
3347
3347
|
return of(result);
|
|
3348
3348
|
}
|
|
3349
|
+
// Only create the Route's `EnvironmentInjector` if it matches the attempted
|
|
3350
|
+
// navigation
|
|
3351
|
+
injector = getOrCreateRouteInjectorIfNeeded(route, injector);
|
|
3349
3352
|
return runCanMatchGuards(injector, route, segments, urlSerializer)
|
|
3350
3353
|
.pipe(map((v) => v === true ? result : Object.assign({}, noMatch$1)));
|
|
3351
3354
|
}
|
|
@@ -3682,11 +3685,11 @@ class ApplyRedirects {
|
|
|
3682
3685
|
}
|
|
3683
3686
|
return matchWithChecks(rawSegmentGroup, route, segments, injector, this.urlSerializer)
|
|
3684
3687
|
.pipe(switchMap(({ matched, consumedSegments, remainingSegments }) => {
|
|
3688
|
+
var _a;
|
|
3685
3689
|
if (!matched)
|
|
3686
3690
|
return noMatch(rawSegmentGroup);
|
|
3687
|
-
//
|
|
3688
|
-
|
|
3689
|
-
injector = getOrCreateRouteInjectorIfNeeded(route, injector);
|
|
3691
|
+
// If the route has an injector created from providers, we should start using that.
|
|
3692
|
+
injector = (_a = route._injector) !== null && _a !== void 0 ? _a : injector;
|
|
3690
3693
|
const childConfig$ = this.getChildConfig(injector, route, segments);
|
|
3691
3694
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
3692
3695
|
var _a;
|
|
@@ -3817,7 +3820,7 @@ function applyRedirects(environmentInjector, configLoader, urlSerializer, config
|
|
|
3817
3820
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3818
3821
|
* found in the LICENSE file at https://angular.io/license
|
|
3819
3822
|
*/
|
|
3820
|
-
const NG_DEV_MODE$
|
|
3823
|
+
const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
3821
3824
|
class NoMatch {
|
|
3822
3825
|
}
|
|
3823
3826
|
function newObservableError(e) {
|
|
@@ -3941,7 +3944,7 @@ class Recognizer {
|
|
|
3941
3944
|
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
3942
3945
|
// production bundle size. This value is intended only to surface a warning to users
|
|
3943
3946
|
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
3944
|
-
(NG_DEV_MODE$
|
|
3947
|
+
(NG_DEV_MODE$3 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
|
|
3945
3948
|
pathIndexShift));
|
|
3946
3949
|
matchResult = of({
|
|
3947
3950
|
snapshot,
|
|
@@ -3958,22 +3961,21 @@ class Recognizer {
|
|
|
3958
3961
|
return null;
|
|
3959
3962
|
}
|
|
3960
3963
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
3961
|
-
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), (NG_DEV_MODE$
|
|
3964
|
+
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze(Object.assign({}, this.urlTree.queryParams)), this.urlTree.fragment, getData(route), getOutlet(route), (_b = (_a = route.component) !== null && _a !== void 0 ? _a : route._loadedComponent) !== null && _b !== void 0 ? _b : null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), (NG_DEV_MODE$3 ?
|
|
3962
3965
|
getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
3963
3966
|
pathIndexShift));
|
|
3964
3967
|
return { snapshot, consumedSegments, remainingSegments };
|
|
3965
3968
|
}));
|
|
3966
3969
|
}
|
|
3967
3970
|
return matchResult.pipe(switchMap((result) => {
|
|
3968
|
-
var _a;
|
|
3971
|
+
var _a, _b;
|
|
3969
3972
|
if (result === null) {
|
|
3970
3973
|
return of(null);
|
|
3971
3974
|
}
|
|
3972
3975
|
const { snapshot, consumedSegments, remainingSegments } = result;
|
|
3973
|
-
//
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
const childInjector = (_a = route._loadedInjector) !== null && _a !== void 0 ? _a : injector;
|
|
3976
|
+
// If the route has an injector created from providers, we should start using that.
|
|
3977
|
+
injector = (_a = route._injector) !== null && _a !== void 0 ? _a : injector;
|
|
3978
|
+
const childInjector = (_b = route._loadedInjector) !== null && _b !== void 0 ? _b : injector;
|
|
3977
3979
|
const childConfig = getChildConfig(route);
|
|
3978
3980
|
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments,
|
|
3979
3981
|
// Filter out routes with redirectTo because we are trying to create activated route
|
|
@@ -4282,7 +4284,7 @@ class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
|
4282
4284
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4283
4285
|
* found in the LICENSE file at https://angular.io/license
|
|
4284
4286
|
*/
|
|
4285
|
-
const NG_DEV_MODE$
|
|
4287
|
+
const NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4286
4288
|
/**
|
|
4287
4289
|
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4288
4290
|
*
|
|
@@ -4317,7 +4319,7 @@ class RouterConfigLoader {
|
|
|
4317
4319
|
if (this.onLoadEndListener) {
|
|
4318
4320
|
this.onLoadEndListener(route);
|
|
4319
4321
|
}
|
|
4320
|
-
NG_DEV_MODE$
|
|
4322
|
+
NG_DEV_MODE$2 && assertStandalone((_a = route.path) !== null && _a !== void 0 ? _a : '', component);
|
|
4321
4323
|
route._loadedComponent = component;
|
|
4322
4324
|
}), finalize(() => {
|
|
4323
4325
|
this.componentLoaders.delete(route);
|
|
@@ -4360,7 +4362,7 @@ class RouterConfigLoader {
|
|
|
4360
4362
|
rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
|
|
4361
4363
|
}
|
|
4362
4364
|
const routes = rawRoutes.map(standardizeConfig);
|
|
4363
|
-
NG_DEV_MODE$
|
|
4365
|
+
NG_DEV_MODE$2 && validateConfig(routes, route.path, requireStandaloneComponents);
|
|
4364
4366
|
return { routes, injector };
|
|
4365
4367
|
}), finalize(() => {
|
|
4366
4368
|
this.childrenLoaders.delete(route);
|
|
@@ -4382,9 +4384,9 @@ class RouterConfigLoader {
|
|
|
4382
4384
|
}));
|
|
4383
4385
|
}
|
|
4384
4386
|
}
|
|
4385
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4386
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4387
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4388
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterConfigLoader });
|
|
4389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4388
4390
|
type: Injectable
|
|
4389
4391
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4390
4392
|
|
|
@@ -4419,7 +4421,7 @@ class DefaultUrlHandlingStrategy {
|
|
|
4419
4421
|
}
|
|
4420
4422
|
}
|
|
4421
4423
|
|
|
4422
|
-
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4424
|
+
const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4423
4425
|
function defaultErrorHandler(error) {
|
|
4424
4426
|
throw error;
|
|
4425
4427
|
}
|
|
@@ -4990,7 +4992,7 @@ class Router {
|
|
|
4990
4992
|
* ```
|
|
4991
4993
|
*/
|
|
4992
4994
|
resetConfig(config) {
|
|
4993
|
-
NG_DEV_MODE && validateConfig(config);
|
|
4995
|
+
NG_DEV_MODE$1 && validateConfig(config);
|
|
4994
4996
|
this.config = config.map(standardizeConfig);
|
|
4995
4997
|
this.navigated = false;
|
|
4996
4998
|
this.lastSuccessfulId = -1;
|
|
@@ -5348,9 +5350,9 @@ class Router {
|
|
|
5348
5350
|
return { navigationId };
|
|
5349
5351
|
}
|
|
5350
5352
|
}
|
|
5351
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5352
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5353
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5354
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router });
|
|
5355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router, decorators: [{
|
|
5354
5356
|
type: Injectable
|
|
5355
5357
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5356
5358
|
function validateCommands(commands) {
|
|
@@ -5542,9 +5544,9 @@ class RouterLink {
|
|
|
5542
5544
|
});
|
|
5543
5545
|
}
|
|
5544
5546
|
}
|
|
5545
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5546
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
5547
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5547
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5548
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.2", type: RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
|
|
5549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLink, decorators: [{
|
|
5548
5550
|
type: Directive,
|
|
5549
5551
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5550
5552
|
}], ctorParameters: function () {
|
|
@@ -5663,9 +5665,9 @@ class RouterLinkWithHref {
|
|
|
5663
5665
|
});
|
|
5664
5666
|
}
|
|
5665
5667
|
}
|
|
5666
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5667
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
5668
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5668
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5669
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.2", type: RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", state: "state", relativeTo: "relativeTo", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
|
|
5670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5669
5671
|
type: Directive,
|
|
5670
5672
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5671
5673
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5892,9 +5894,9 @@ class RouterLinkActive {
|
|
|
5892
5894
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5893
5895
|
}
|
|
5894
5896
|
}
|
|
5895
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5896
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
5897
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5897
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }, { token: RouterLinkWithHref, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5898
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.2", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
5899
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5898
5900
|
type: Directive,
|
|
5899
5901
|
args: [{
|
|
5900
5902
|
selector: '[routerLinkActive]',
|
|
@@ -6000,9 +6002,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
6000
6002
|
}
|
|
6001
6003
|
}
|
|
6002
6004
|
}
|
|
6003
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6004
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6005
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6006
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
6007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
6006
6008
|
type: Injectable,
|
|
6007
6009
|
args: [{ providedIn: 'root' }]
|
|
6008
6010
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -6039,6 +6041,12 @@ class PreloadAllModules {
|
|
|
6039
6041
|
return fn().pipe(catchError(() => of(null)));
|
|
6040
6042
|
}
|
|
6041
6043
|
}
|
|
6044
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6045
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6047
|
+
type: Injectable,
|
|
6048
|
+
args: [{ providedIn: 'root' }]
|
|
6049
|
+
}] });
|
|
6042
6050
|
/**
|
|
6043
6051
|
* @description
|
|
6044
6052
|
*
|
|
@@ -6053,6 +6061,12 @@ class NoPreloading {
|
|
|
6053
6061
|
return of(null);
|
|
6054
6062
|
}
|
|
6055
6063
|
}
|
|
6064
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6065
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6067
|
+
type: Injectable,
|
|
6068
|
+
args: [{ providedIn: 'root' }]
|
|
6069
|
+
}] });
|
|
6056
6070
|
/**
|
|
6057
6071
|
* The preloader optimistically loads all router configurations to
|
|
6058
6072
|
* make navigations into lazily-loaded sections of the application faster.
|
|
@@ -6137,12 +6151,13 @@ class RouterPreloader {
|
|
|
6137
6151
|
});
|
|
6138
6152
|
}
|
|
6139
6153
|
}
|
|
6140
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6141
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6154
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6155
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterPreloader });
|
|
6156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6143
6157
|
type: Injectable
|
|
6144
6158
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6145
6159
|
|
|
6160
|
+
const ROUTER_SCROLLER = new InjectionToken('');
|
|
6146
6161
|
class RouterScroller {
|
|
6147
6162
|
constructor(router,
|
|
6148
6163
|
/** @docsNotRequired */ viewportScroller, options = {}) {
|
|
@@ -6218,9 +6233,9 @@ class RouterScroller {
|
|
|
6218
6233
|
}
|
|
6219
6234
|
}
|
|
6220
6235
|
}
|
|
6221
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6222
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6236
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6237
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller });
|
|
6238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6224
6239
|
type: Injectable
|
|
6225
6240
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6226
6241
|
|
|
@@ -6231,6 +6246,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1",
|
|
|
6231
6246
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6232
6247
|
* found in the LICENSE file at https://angular.io/license
|
|
6233
6248
|
*/
|
|
6249
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
6234
6250
|
/**
|
|
6235
6251
|
* The directives defined in the `RouterModule`.
|
|
6236
6252
|
*/
|
|
@@ -6240,11 +6256,15 @@ const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterL
|
|
|
6240
6256
|
*
|
|
6241
6257
|
* @publicApi
|
|
6242
6258
|
*/
|
|
6243
|
-
const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION'
|
|
6259
|
+
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE ? 'router config' : 'ROUTER_CONFIGURATION', {
|
|
6260
|
+
providedIn: 'root',
|
|
6261
|
+
factory: () => ({}),
|
|
6262
|
+
});
|
|
6244
6263
|
/**
|
|
6245
6264
|
* @docsNotRequired
|
|
6246
6265
|
*/
|
|
6247
|
-
const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');
|
|
6266
|
+
const ROUTER_FORROOT_GUARD = new InjectionToken(NG_DEV_MODE ? 'router duplicate forRoot guard' : 'ROUTER_FORROOT_GUARD');
|
|
6267
|
+
const ROUTER_PRELOADER = new InjectionToken(NG_DEV_MODE ? 'router preloader' : '');
|
|
6248
6268
|
const ROUTER_PROVIDERS = [
|
|
6249
6269
|
Location,
|
|
6250
6270
|
{ provide: UrlSerializer, useClass: DefaultUrlSerializer },
|
|
@@ -6259,10 +6279,6 @@ const ROUTER_PROVIDERS = [
|
|
|
6259
6279
|
},
|
|
6260
6280
|
ChildrenOutletContexts,
|
|
6261
6281
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6262
|
-
RouterPreloader,
|
|
6263
|
-
NoPreloading,
|
|
6264
|
-
PreloadAllModules,
|
|
6265
|
-
{ provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },
|
|
6266
6282
|
RouterConfigLoader,
|
|
6267
6283
|
];
|
|
6268
6284
|
function routerNgProbeToken() {
|
|
@@ -6315,6 +6331,7 @@ class RouterModule {
|
|
|
6315
6331
|
ngModule: RouterModule,
|
|
6316
6332
|
providers: [
|
|
6317
6333
|
ROUTER_PROVIDERS,
|
|
6334
|
+
NG_DEV_MODE ? ((config === null || config === void 0 ? void 0 : config.enableTracing) ? provideTracing() : []) : [],
|
|
6318
6335
|
provideRoutes(routes),
|
|
6319
6336
|
{
|
|
6320
6337
|
provide: ROUTER_FORROOT_GUARD,
|
|
@@ -6322,22 +6339,11 @@ class RouterModule {
|
|
|
6322
6339
|
deps: [[Router, new Optional(), new SkipSelf()]]
|
|
6323
6340
|
},
|
|
6324
6341
|
{ provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
deps: [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], ROUTER_CONFIGURATION]
|
|
6329
|
-
},
|
|
6330
|
-
{
|
|
6331
|
-
provide: RouterScroller,
|
|
6332
|
-
useFactory: createRouterScroller,
|
|
6333
|
-
deps: [Router, ViewportScroller, ROUTER_CONFIGURATION]
|
|
6334
|
-
},
|
|
6335
|
-
{
|
|
6336
|
-
provide: PreloadingStrategy,
|
|
6337
|
-
useExisting: config && config.preloadingStrategy ? config.preloadingStrategy :
|
|
6338
|
-
NoPreloading
|
|
6339
|
-
},
|
|
6342
|
+
(config === null || config === void 0 ? void 0 : config.useHash) ? provideHashLocationStrategy() : providePathLocationStrategy(),
|
|
6343
|
+
provideRouterScroller(),
|
|
6344
|
+
(config === null || config === void 0 ? void 0 : config.preloadingStrategy) ? providePreloading(config.preloadingStrategy) : [],
|
|
6340
6345
|
{ provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken },
|
|
6346
|
+
(config === null || config === void 0 ? void 0 : config.initialNavigation) ? provideInitialNavigation(config) : [],
|
|
6341
6347
|
provideRouterInitializer(),
|
|
6342
6348
|
],
|
|
6343
6349
|
};
|
|
@@ -6362,10 +6368,10 @@ class RouterModule {
|
|
|
6362
6368
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6363
6369
|
}
|
|
6364
6370
|
}
|
|
6365
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6366
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
6367
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6368
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6371
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6372
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6373
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule });
|
|
6374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule, decorators: [{
|
|
6369
6375
|
type: NgModule,
|
|
6370
6376
|
args: [{
|
|
6371
6377
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6381,18 +6387,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1",
|
|
|
6381
6387
|
type: Optional
|
|
6382
6388
|
}] }];
|
|
6383
6389
|
} });
|
|
6384
|
-
function
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6390
|
+
function provideRouterScroller() {
|
|
6391
|
+
return {
|
|
6392
|
+
provide: ROUTER_SCROLLER,
|
|
6393
|
+
useFactory: () => {
|
|
6394
|
+
const router = inject(Router);
|
|
6395
|
+
const viewportScroller = inject(ViewportScroller);
|
|
6396
|
+
const config = inject(ROUTER_CONFIGURATION);
|
|
6397
|
+
if (config.scrollOffset) {
|
|
6398
|
+
viewportScroller.setOffset(config.scrollOffset);
|
|
6399
|
+
}
|
|
6400
|
+
return new RouterScroller(router, viewportScroller, config);
|
|
6401
|
+
},
|
|
6402
|
+
};
|
|
6403
|
+
}
|
|
6404
|
+
function provideHashLocationStrategy() {
|
|
6405
|
+
return { provide: LocationStrategy, useClass: HashLocationStrategy };
|
|
6389
6406
|
}
|
|
6390
|
-
function
|
|
6391
|
-
return
|
|
6392
|
-
new PathLocationStrategy(platformLocationStrategy, baseHref);
|
|
6407
|
+
function providePathLocationStrategy() {
|
|
6408
|
+
return { provide: LocationStrategy, useClass: PathLocationStrategy };
|
|
6393
6409
|
}
|
|
6394
6410
|
function provideForRootGuard(router) {
|
|
6395
|
-
if (
|
|
6411
|
+
if (NG_DEV_MODE && router) {
|
|
6396
6412
|
throw new Error(`RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
|
|
6397
6413
|
}
|
|
6398
6414
|
return 'guarded';
|
|
@@ -6429,17 +6445,6 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
|
|
|
6429
6445
|
}
|
|
6430
6446
|
router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
|
|
6431
6447
|
assignExtraOptionsToRouter(opts, router);
|
|
6432
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && opts.enableTracing) {
|
|
6433
|
-
router.events.subscribe((e) => {
|
|
6434
|
-
var _a, _b;
|
|
6435
|
-
// tslint:disable:no-console
|
|
6436
|
-
(_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, `Router Event: ${e.constructor.name}`);
|
|
6437
|
-
console.log(stringifyEvent(e));
|
|
6438
|
-
console.log(e);
|
|
6439
|
-
(_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console);
|
|
6440
|
-
// tslint:enable:no-console
|
|
6441
|
-
});
|
|
6442
|
-
}
|
|
6443
6448
|
return router;
|
|
6444
6449
|
}
|
|
6445
6450
|
function assignExtraOptionsToRouter(opts, router) {
|
|
@@ -6468,112 +6473,138 @@ function assignExtraOptionsToRouter(opts, router) {
|
|
|
6468
6473
|
function rootRoute(router) {
|
|
6469
6474
|
return router.routerState.root;
|
|
6470
6475
|
}
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
*
|
|
6477
|
-
* Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
|
|
6478
|
-
* `afterPreactivation` hook provided by the router.
|
|
6479
|
-
* The router navigation starts, reaches the point when preactivation is done, and then
|
|
6480
|
-
* pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
|
|
6481
|
-
*/
|
|
6482
|
-
class RouterInitializer {
|
|
6483
|
-
constructor(injector) {
|
|
6484
|
-
this.injector = injector;
|
|
6485
|
-
this.initNavigation = false;
|
|
6486
|
-
this.destroyed = false;
|
|
6487
|
-
this.resultOfPreactivationDone = new Subject();
|
|
6488
|
-
}
|
|
6489
|
-
appInitializer() {
|
|
6490
|
-
const p = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6491
|
-
return p.then(() => {
|
|
6492
|
-
// If the injector was destroyed, the DI lookups below will fail.
|
|
6493
|
-
if (this.destroyed) {
|
|
6494
|
-
return Promise.resolve(true);
|
|
6495
|
-
}
|
|
6496
|
-
let resolve = null;
|
|
6497
|
-
const res = new Promise(r => resolve = r);
|
|
6498
|
-
const router = this.injector.get(Router);
|
|
6499
|
-
const opts = this.injector.get(ROUTER_CONFIGURATION);
|
|
6500
|
-
if (opts.initialNavigation === 'disabled') {
|
|
6501
|
-
router.setUpLocationChangeListener();
|
|
6502
|
-
resolve(true);
|
|
6503
|
-
}
|
|
6504
|
-
else if (opts.initialNavigation === 'enabledBlocking') {
|
|
6505
|
-
router.afterPreactivation = () => {
|
|
6506
|
-
// only the initial navigation should be delayed
|
|
6507
|
-
if (!this.initNavigation) {
|
|
6508
|
-
this.initNavigation = true;
|
|
6509
|
-
resolve(true);
|
|
6510
|
-
return this.resultOfPreactivationDone;
|
|
6511
|
-
// subsequent navigations should not be delayed
|
|
6512
|
-
}
|
|
6513
|
-
else {
|
|
6514
|
-
return of(void 0);
|
|
6515
|
-
}
|
|
6516
|
-
};
|
|
6517
|
-
router.initialNavigation();
|
|
6518
|
-
}
|
|
6519
|
-
else {
|
|
6520
|
-
resolve(true);
|
|
6521
|
-
}
|
|
6522
|
-
return res;
|
|
6523
|
-
});
|
|
6524
|
-
}
|
|
6525
|
-
bootstrapListener(bootstrappedComponentRef) {
|
|
6526
|
-
const opts = this.injector.get(ROUTER_CONFIGURATION);
|
|
6527
|
-
const preloader = this.injector.get(RouterPreloader);
|
|
6528
|
-
const routerScroller = this.injector.get(RouterScroller);
|
|
6529
|
-
const router = this.injector.get(Router);
|
|
6530
|
-
const ref = this.injector.get(ApplicationRef);
|
|
6476
|
+
function getBootstrapListener() {
|
|
6477
|
+
const injector = inject(Injector);
|
|
6478
|
+
return (bootstrappedComponentRef) => {
|
|
6479
|
+
var _a, _b;
|
|
6480
|
+
const ref = injector.get(ApplicationRef);
|
|
6531
6481
|
if (bootstrappedComponentRef !== ref.components[0]) {
|
|
6532
6482
|
return;
|
|
6533
6483
|
}
|
|
6484
|
+
const router = injector.get(Router);
|
|
6485
|
+
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6534
6486
|
// Default case
|
|
6535
|
-
if (
|
|
6487
|
+
if (injector.get(INITIAL_NAVIGATION, null, InjectFlags.Optional) === null) {
|
|
6536
6488
|
router.initialNavigation();
|
|
6537
6489
|
}
|
|
6538
|
-
|
|
6539
|
-
|
|
6490
|
+
(_a = injector.get(ROUTER_PRELOADER, null, InjectFlags.Optional)) === null || _a === void 0 ? void 0 : _a.setUpPreloading();
|
|
6491
|
+
(_b = injector.get(ROUTER_SCROLLER, null, InjectFlags.Optional)) === null || _b === void 0 ? void 0 : _b.init();
|
|
6540
6492
|
router.resetRootComponentType(ref.componentTypes[0]);
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
}
|
|
6544
|
-
ngOnDestroy() {
|
|
6545
|
-
this.destroyed = true;
|
|
6546
|
-
}
|
|
6547
|
-
}
|
|
6548
|
-
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.1", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6549
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.1", ngImport: i0, type: RouterInitializer });
|
|
6550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6551
|
-
type: Injectable
|
|
6552
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6553
|
-
function getAppInitializer(r) {
|
|
6554
|
-
return r.appInitializer.bind(r);
|
|
6555
|
-
}
|
|
6556
|
-
function getBootstrapListener(r) {
|
|
6557
|
-
return r.bootstrapListener.bind(r);
|
|
6493
|
+
bootstrapDone.next();
|
|
6494
|
+
bootstrapDone.complete();
|
|
6495
|
+
};
|
|
6558
6496
|
}
|
|
6497
|
+
// TODO(atscott): This should not be in the public API
|
|
6559
6498
|
/**
|
|
6560
6499
|
* A [DI token](guide/glossary/#di-token) for the router initializer that
|
|
6561
6500
|
* is called after the app is bootstrapped.
|
|
6562
6501
|
*
|
|
6563
6502
|
* @publicApi
|
|
6564
6503
|
*/
|
|
6565
|
-
const ROUTER_INITIALIZER = new InjectionToken('Router Initializer');
|
|
6504
|
+
const ROUTER_INITIALIZER = new InjectionToken(NG_DEV_MODE ? 'Router Initializer' : '');
|
|
6505
|
+
function provideInitialNavigation(config) {
|
|
6506
|
+
return [
|
|
6507
|
+
config.initialNavigation === 'disabled' ? provideDisabledInitialNavigation() : [],
|
|
6508
|
+
config.initialNavigation === 'enabledBlocking' ? provideEnabledBlockingInitialNavigation() : [],
|
|
6509
|
+
];
|
|
6510
|
+
}
|
|
6566
6511
|
function provideRouterInitializer() {
|
|
6567
6512
|
return [
|
|
6568
|
-
|
|
6513
|
+
// ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just
|
|
6514
|
+
// have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.
|
|
6515
|
+
{ provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener },
|
|
6516
|
+
{ provide: APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER },
|
|
6517
|
+
];
|
|
6518
|
+
}
|
|
6519
|
+
/**
|
|
6520
|
+
* A subject used to indicate that the bootstrapping phase is done. When initial navigation is
|
|
6521
|
+
* `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing
|
|
6522
|
+
* to the activation phase.
|
|
6523
|
+
*/
|
|
6524
|
+
const BOOTSTRAP_DONE = new InjectionToken(NG_DEV_MODE ? 'bootstrap done indicator' : '', {
|
|
6525
|
+
factory: () => {
|
|
6526
|
+
return new Subject();
|
|
6527
|
+
}
|
|
6528
|
+
});
|
|
6529
|
+
function provideEnabledBlockingInitialNavigation() {
|
|
6530
|
+
return [
|
|
6531
|
+
{ provide: INITIAL_NAVIGATION, useValue: 'enabledBlocking' },
|
|
6569
6532
|
{
|
|
6570
6533
|
provide: APP_INITIALIZER,
|
|
6571
6534
|
multi: true,
|
|
6572
|
-
|
|
6573
|
-
|
|
6535
|
+
deps: [Injector],
|
|
6536
|
+
useFactory: (injector) => {
|
|
6537
|
+
const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6538
|
+
let initNavigation = false;
|
|
6539
|
+
return () => {
|
|
6540
|
+
return locationInitialized.then(() => {
|
|
6541
|
+
return new Promise(resolve => {
|
|
6542
|
+
const router = injector.get(Router);
|
|
6543
|
+
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6544
|
+
router.afterPreactivation = () => {
|
|
6545
|
+
// only the initial navigation should be delayed
|
|
6546
|
+
if (!initNavigation) {
|
|
6547
|
+
initNavigation = true;
|
|
6548
|
+
resolve(true);
|
|
6549
|
+
return bootstrapDone;
|
|
6550
|
+
// subsequent navigations should not be delayed
|
|
6551
|
+
}
|
|
6552
|
+
else {
|
|
6553
|
+
return of(void 0);
|
|
6554
|
+
}
|
|
6555
|
+
};
|
|
6556
|
+
router.initialNavigation();
|
|
6557
|
+
});
|
|
6558
|
+
});
|
|
6559
|
+
};
|
|
6560
|
+
}
|
|
6574
6561
|
},
|
|
6575
|
-
|
|
6576
|
-
|
|
6562
|
+
];
|
|
6563
|
+
}
|
|
6564
|
+
const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE ? 'initial navigation' : '');
|
|
6565
|
+
function provideDisabledInitialNavigation() {
|
|
6566
|
+
return [
|
|
6567
|
+
{
|
|
6568
|
+
provide: APP_INITIALIZER,
|
|
6569
|
+
multi: true,
|
|
6570
|
+
useFactory: () => {
|
|
6571
|
+
const router = inject(Router);
|
|
6572
|
+
return () => {
|
|
6573
|
+
router.setUpLocationChangeListener();
|
|
6574
|
+
};
|
|
6575
|
+
}
|
|
6576
|
+
},
|
|
6577
|
+
{ provide: INITIAL_NAVIGATION, useValue: 'disabled' }
|
|
6578
|
+
];
|
|
6579
|
+
}
|
|
6580
|
+
function provideTracing() {
|
|
6581
|
+
if (NG_DEV_MODE) {
|
|
6582
|
+
return [{
|
|
6583
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
6584
|
+
multi: true,
|
|
6585
|
+
useFactory: () => {
|
|
6586
|
+
const router = inject(Router);
|
|
6587
|
+
return () => router.events.subscribe((e) => {
|
|
6588
|
+
var _a, _b;
|
|
6589
|
+
// tslint:disable:no-console
|
|
6590
|
+
(_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, `Router Event: ${e.constructor.name}`);
|
|
6591
|
+
console.log(stringifyEvent(e));
|
|
6592
|
+
console.log(e);
|
|
6593
|
+
(_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console);
|
|
6594
|
+
// tslint:enable:no-console
|
|
6595
|
+
});
|
|
6596
|
+
}
|
|
6597
|
+
}];
|
|
6598
|
+
}
|
|
6599
|
+
else {
|
|
6600
|
+
return [];
|
|
6601
|
+
}
|
|
6602
|
+
}
|
|
6603
|
+
function providePreloading(preloadingStrategy) {
|
|
6604
|
+
return [
|
|
6605
|
+
RouterPreloader,
|
|
6606
|
+
{ provide: ROUTER_PRELOADER, useExisting: RouterPreloader },
|
|
6607
|
+
{ provide: PreloadingStrategy, useExisting: preloadingStrategy },
|
|
6577
6608
|
];
|
|
6578
6609
|
}
|
|
6579
6610
|
|
|
@@ -6587,7 +6618,7 @@ function provideRouterInitializer() {
|
|
|
6587
6618
|
/**
|
|
6588
6619
|
* @publicApi
|
|
6589
6620
|
*/
|
|
6590
|
-
const VERSION = new Version('14.1.0-next.
|
|
6621
|
+
const VERSION = new Version('14.1.0-next.2');
|
|
6591
6622
|
|
|
6592
6623
|
/**
|
|
6593
6624
|
* @license
|
|
@@ -6626,5 +6657,5 @@ const VERSION = new Version('14.1.0-next.1');
|
|
|
6626
6657
|
* Generated bundle index. Do not edit.
|
|
6627
6658
|
*/
|
|
6628
6659
|
|
|
6629
|
-
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten };
|
|
6660
|
+
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten, providePreloading as ɵprovidePreloading };
|
|
6630
6661
|
//# sourceMappingURL=router.mjs.map
|