@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/fesm2020/router.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 * as i3 from '@angular/common';
|
|
11
|
-
import { Location, LocationStrategy,
|
|
11
|
+
import { Location, LocationStrategy, HashLocationStrategy, PathLocationStrategy, ViewportScroller, LOCATION_INITIALIZED } from '@angular/common';
|
|
12
12
|
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';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
@@ -2489,9 +2489,9 @@ class RouterOutlet {
|
|
|
2489
2489
|
this.activateEvents.emit(this.activated.instance);
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2493
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
2494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2492
|
+
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 });
|
|
2493
|
+
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 });
|
|
2494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2495
2495
|
type: Directive,
|
|
2496
2496
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2497
2497
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
@@ -2548,9 +2548,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2548
2548
|
*/
|
|
2549
2549
|
class ɵEmptyOutletComponent {
|
|
2550
2550
|
}
|
|
2551
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2552
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
2553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
2551
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2552
|
+
ɵ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"] }] });
|
|
2553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2554
2554
|
type: Component,
|
|
2555
2555
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2556
2556
|
}] });
|
|
@@ -3337,6 +3337,9 @@ function matchWithChecks(segmentGroup, route, segments, injector, urlSerializer)
|
|
|
3337
3337
|
if (!result.matched) {
|
|
3338
3338
|
return of(result);
|
|
3339
3339
|
}
|
|
3340
|
+
// Only create the Route's `EnvironmentInjector` if it matches the attempted
|
|
3341
|
+
// navigation
|
|
3342
|
+
injector = getOrCreateRouteInjectorIfNeeded(route, injector);
|
|
3340
3343
|
return runCanMatchGuards(injector, route, segments, urlSerializer)
|
|
3341
3344
|
.pipe(map((v) => v === true ? result : { ...noMatch$1 }));
|
|
3342
3345
|
}
|
|
@@ -3675,9 +3678,8 @@ class ApplyRedirects {
|
|
|
3675
3678
|
.pipe(switchMap(({ matched, consumedSegments, remainingSegments }) => {
|
|
3676
3679
|
if (!matched)
|
|
3677
3680
|
return noMatch(rawSegmentGroup);
|
|
3678
|
-
//
|
|
3679
|
-
|
|
3680
|
-
injector = getOrCreateRouteInjectorIfNeeded(route, injector);
|
|
3681
|
+
// If the route has an injector created from providers, we should start using that.
|
|
3682
|
+
injector = route._injector ?? injector;
|
|
3681
3683
|
const childConfig$ = this.getChildConfig(injector, route, segments);
|
|
3682
3684
|
return childConfig$.pipe(mergeMap((routerConfig) => {
|
|
3683
3685
|
const childInjector = routerConfig.injector ?? injector;
|
|
@@ -3807,7 +3809,7 @@ function applyRedirects(environmentInjector, configLoader, urlSerializer, config
|
|
|
3807
3809
|
* Use of this source code is governed by an MIT-style license that can be
|
|
3808
3810
|
* found in the LICENSE file at https://angular.io/license
|
|
3809
3811
|
*/
|
|
3810
|
-
const NG_DEV_MODE$
|
|
3812
|
+
const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
3811
3813
|
class NoMatch {
|
|
3812
3814
|
}
|
|
3813
3815
|
function newObservableError(e) {
|
|
@@ -3929,7 +3931,7 @@ class Recognizer {
|
|
|
3929
3931
|
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
3930
3932
|
// production bundle size. This value is intended only to surface a warning to users
|
|
3931
3933
|
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
3932
|
-
(NG_DEV_MODE$
|
|
3934
|
+
(NG_DEV_MODE$3 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
|
|
3933
3935
|
pathIndexShift));
|
|
3934
3936
|
matchResult = of({
|
|
3935
3937
|
snapshot,
|
|
@@ -3945,7 +3947,7 @@ class Recognizer {
|
|
|
3945
3947
|
return null;
|
|
3946
3948
|
}
|
|
3947
3949
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
3948
|
-
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), (NG_DEV_MODE$
|
|
3950
|
+
const snapshot = new ActivatedRouteSnapshot(consumedSegments, parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), (NG_DEV_MODE$3 ?
|
|
3949
3951
|
getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
3950
3952
|
pathIndexShift));
|
|
3951
3953
|
return { snapshot, consumedSegments, remainingSegments };
|
|
@@ -3956,9 +3958,8 @@ class Recognizer {
|
|
|
3956
3958
|
return of(null);
|
|
3957
3959
|
}
|
|
3958
3960
|
const { snapshot, consumedSegments, remainingSegments } = result;
|
|
3959
|
-
//
|
|
3960
|
-
|
|
3961
|
-
injector = getOrCreateRouteInjectorIfNeeded(route, injector);
|
|
3961
|
+
// If the route has an injector created from providers, we should start using that.
|
|
3962
|
+
injector = route._injector ?? injector;
|
|
3962
3963
|
const childInjector = route._loadedInjector ?? injector;
|
|
3963
3964
|
const childConfig = getChildConfig(route);
|
|
3964
3965
|
const { segmentGroup, slicedSegments } = split(rawSegment, consumedSegments, remainingSegments,
|
|
@@ -4266,7 +4267,7 @@ class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
|
4266
4267
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4267
4268
|
* found in the LICENSE file at https://angular.io/license
|
|
4268
4269
|
*/
|
|
4269
|
-
const NG_DEV_MODE$
|
|
4270
|
+
const NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4270
4271
|
/**
|
|
4271
4272
|
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
|
4272
4273
|
*
|
|
@@ -4300,7 +4301,7 @@ class RouterConfigLoader {
|
|
|
4300
4301
|
if (this.onLoadEndListener) {
|
|
4301
4302
|
this.onLoadEndListener(route);
|
|
4302
4303
|
}
|
|
4303
|
-
NG_DEV_MODE$
|
|
4304
|
+
NG_DEV_MODE$2 && assertStandalone(route.path ?? '', component);
|
|
4304
4305
|
route._loadedComponent = component;
|
|
4305
4306
|
}), finalize(() => {
|
|
4306
4307
|
this.componentLoaders.delete(route);
|
|
@@ -4343,7 +4344,7 @@ class RouterConfigLoader {
|
|
|
4343
4344
|
rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
|
|
4344
4345
|
}
|
|
4345
4346
|
const routes = rawRoutes.map(standardizeConfig);
|
|
4346
|
-
NG_DEV_MODE$
|
|
4347
|
+
NG_DEV_MODE$2 && validateConfig(routes, route.path, requireStandaloneComponents);
|
|
4347
4348
|
return { routes, injector };
|
|
4348
4349
|
}), finalize(() => {
|
|
4349
4350
|
this.childrenLoaders.delete(route);
|
|
@@ -4365,9 +4366,9 @@ class RouterConfigLoader {
|
|
|
4365
4366
|
}));
|
|
4366
4367
|
}
|
|
4367
4368
|
}
|
|
4368
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4369
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4370
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
4369
|
+
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 });
|
|
4370
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterConfigLoader });
|
|
4371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4371
4372
|
type: Injectable
|
|
4372
4373
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4373
4374
|
|
|
@@ -4409,7 +4410,7 @@ class DefaultUrlHandlingStrategy {
|
|
|
4409
4410
|
* Use of this source code is governed by an MIT-style license that can be
|
|
4410
4411
|
* found in the LICENSE file at https://angular.io/license
|
|
4411
4412
|
*/
|
|
4412
|
-
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4413
|
+
const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
4413
4414
|
function defaultErrorHandler(error) {
|
|
4414
4415
|
throw error;
|
|
4415
4416
|
}
|
|
@@ -4988,7 +4989,7 @@ class Router {
|
|
|
4988
4989
|
* ```
|
|
4989
4990
|
*/
|
|
4990
4991
|
resetConfig(config) {
|
|
4991
|
-
NG_DEV_MODE && validateConfig(config);
|
|
4992
|
+
NG_DEV_MODE$1 && validateConfig(config);
|
|
4992
4993
|
this.config = config.map(standardizeConfig);
|
|
4993
4994
|
this.navigated = false;
|
|
4994
4995
|
this.lastSuccessfulId = -1;
|
|
@@ -5343,9 +5344,9 @@ class Router {
|
|
|
5343
5344
|
return { navigationId };
|
|
5344
5345
|
}
|
|
5345
5346
|
}
|
|
5346
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5347
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5348
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5347
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5348
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router });
|
|
5349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: Router, decorators: [{
|
|
5349
5350
|
type: Injectable
|
|
5350
5351
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5351
5352
|
function validateCommands(commands) {
|
|
@@ -5544,9 +5545,9 @@ class RouterLink {
|
|
|
5544
5545
|
});
|
|
5545
5546
|
}
|
|
5546
5547
|
}
|
|
5547
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5548
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
5549
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5548
|
+
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 });
|
|
5549
|
+
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 });
|
|
5550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLink, decorators: [{
|
|
5550
5551
|
type: Directive,
|
|
5551
5552
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5552
5553
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5663,9 +5664,9 @@ class RouterLinkWithHref {
|
|
|
5663
5664
|
});
|
|
5664
5665
|
}
|
|
5665
5666
|
}
|
|
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.
|
|
5667
|
+
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 });
|
|
5668
|
+
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 });
|
|
5669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5669
5670
|
type: Directive,
|
|
5670
5671
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5671
5672
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5890,9 +5891,9 @@ class RouterLinkActive {
|
|
|
5890
5891
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5891
5892
|
}
|
|
5892
5893
|
}
|
|
5893
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5894
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.0-next.
|
|
5895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5894
|
+
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 });
|
|
5895
|
+
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 });
|
|
5896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5896
5897
|
type: Directive,
|
|
5897
5898
|
args: [{
|
|
5898
5899
|
selector: '[routerLinkActive]',
|
|
@@ -5995,9 +5996,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5995
5996
|
}
|
|
5996
5997
|
}
|
|
5997
5998
|
}
|
|
5998
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5999
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
5999
|
+
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 });
|
|
6000
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
6001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
6001
6002
|
type: Injectable,
|
|
6002
6003
|
args: [{ providedIn: 'root' }]
|
|
6003
6004
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -6034,6 +6035,12 @@ class PreloadAllModules {
|
|
|
6034
6035
|
return fn().pipe(catchError(() => of(null)));
|
|
6035
6036
|
}
|
|
6036
6037
|
}
|
|
6038
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6039
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6041
|
+
type: Injectable,
|
|
6042
|
+
args: [{ providedIn: 'root' }]
|
|
6043
|
+
}] });
|
|
6037
6044
|
/**
|
|
6038
6045
|
* @description
|
|
6039
6046
|
*
|
|
@@ -6048,6 +6055,12 @@ class NoPreloading {
|
|
|
6048
6055
|
return of(null);
|
|
6049
6056
|
}
|
|
6050
6057
|
}
|
|
6058
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6059
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6061
|
+
type: Injectable,
|
|
6062
|
+
args: [{ providedIn: 'root' }]
|
|
6063
|
+
}] });
|
|
6051
6064
|
/**
|
|
6052
6065
|
* The preloader optimistically loads all router configurations to
|
|
6053
6066
|
* make navigations into lazily-loaded sections of the application faster.
|
|
@@ -6130,9 +6143,9 @@ class RouterPreloader {
|
|
|
6130
6143
|
});
|
|
6131
6144
|
}
|
|
6132
6145
|
}
|
|
6133
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6134
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.
|
|
6146
|
+
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 });
|
|
6147
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterPreloader });
|
|
6148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6136
6149
|
type: Injectable
|
|
6137
6150
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
6138
6151
|
|
|
@@ -6143,6 +6156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1",
|
|
|
6143
6156
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6144
6157
|
* found in the LICENSE file at https://angular.io/license
|
|
6145
6158
|
*/
|
|
6159
|
+
const ROUTER_SCROLLER = new InjectionToken('');
|
|
6146
6160
|
class RouterScroller {
|
|
6147
6161
|
constructor(router,
|
|
6148
6162
|
/** @docsNotRequired */ viewportScroller, options = {}) {
|
|
@@ -6218,9 +6232,9 @@ class RouterScroller {
|
|
|
6218
6232
|
}
|
|
6219
6233
|
}
|
|
6220
6234
|
}
|
|
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.
|
|
6235
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6236
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller });
|
|
6237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6224
6238
|
type: Injectable
|
|
6225
6239
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6226
6240
|
|
|
@@ -6231,6 +6245,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1",
|
|
|
6231
6245
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6232
6246
|
* found in the LICENSE file at https://angular.io/license
|
|
6233
6247
|
*/
|
|
6248
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
6234
6249
|
/**
|
|
6235
6250
|
* The directives defined in the `RouterModule`.
|
|
6236
6251
|
*/
|
|
@@ -6240,11 +6255,15 @@ const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterL
|
|
|
6240
6255
|
*
|
|
6241
6256
|
* @publicApi
|
|
6242
6257
|
*/
|
|
6243
|
-
const ROUTER_CONFIGURATION = new InjectionToken('ROUTER_CONFIGURATION'
|
|
6258
|
+
const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE ? 'router config' : 'ROUTER_CONFIGURATION', {
|
|
6259
|
+
providedIn: 'root',
|
|
6260
|
+
factory: () => ({}),
|
|
6261
|
+
});
|
|
6244
6262
|
/**
|
|
6245
6263
|
* @docsNotRequired
|
|
6246
6264
|
*/
|
|
6247
|
-
const ROUTER_FORROOT_GUARD = new InjectionToken('ROUTER_FORROOT_GUARD');
|
|
6265
|
+
const ROUTER_FORROOT_GUARD = new InjectionToken(NG_DEV_MODE ? 'router duplicate forRoot guard' : 'ROUTER_FORROOT_GUARD');
|
|
6266
|
+
const ROUTER_PRELOADER = new InjectionToken(NG_DEV_MODE ? 'router preloader' : '');
|
|
6248
6267
|
const ROUTER_PROVIDERS = [
|
|
6249
6268
|
Location,
|
|
6250
6269
|
{ provide: UrlSerializer, useClass: DefaultUrlSerializer },
|
|
@@ -6259,10 +6278,6 @@ const ROUTER_PROVIDERS = [
|
|
|
6259
6278
|
},
|
|
6260
6279
|
ChildrenOutletContexts,
|
|
6261
6280
|
{ provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6262
|
-
RouterPreloader,
|
|
6263
|
-
NoPreloading,
|
|
6264
|
-
PreloadAllModules,
|
|
6265
|
-
{ provide: ROUTER_CONFIGURATION, useValue: { enableTracing: false } },
|
|
6266
6281
|
RouterConfigLoader,
|
|
6267
6282
|
];
|
|
6268
6283
|
function routerNgProbeToken() {
|
|
@@ -6315,6 +6330,7 @@ class RouterModule {
|
|
|
6315
6330
|
ngModule: RouterModule,
|
|
6316
6331
|
providers: [
|
|
6317
6332
|
ROUTER_PROVIDERS,
|
|
6333
|
+
NG_DEV_MODE ? (config?.enableTracing ? provideTracing() : []) : [],
|
|
6318
6334
|
provideRoutes(routes),
|
|
6319
6335
|
{
|
|
6320
6336
|
provide: ROUTER_FORROOT_GUARD,
|
|
@@ -6322,22 +6338,11 @@ class RouterModule {
|
|
|
6322
6338
|
deps: [[Router, new Optional(), new SkipSelf()]]
|
|
6323
6339
|
},
|
|
6324
6340
|
{ 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
|
-
},
|
|
6341
|
+
config?.useHash ? provideHashLocationStrategy() : providePathLocationStrategy(),
|
|
6342
|
+
provideRouterScroller(),
|
|
6343
|
+
config?.preloadingStrategy ? providePreloading(config.preloadingStrategy) : [],
|
|
6340
6344
|
{ provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken },
|
|
6345
|
+
config?.initialNavigation ? provideInitialNavigation(config) : [],
|
|
6341
6346
|
provideRouterInitializer(),
|
|
6342
6347
|
],
|
|
6343
6348
|
};
|
|
@@ -6362,10 +6367,10 @@ class RouterModule {
|
|
|
6362
6367
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6363
6368
|
}
|
|
6364
6369
|
}
|
|
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.
|
|
6370
|
+
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 });
|
|
6371
|
+
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] });
|
|
6372
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule });
|
|
6373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.2", ngImport: i0, type: RouterModule, decorators: [{
|
|
6369
6374
|
type: NgModule,
|
|
6370
6375
|
args: [{
|
|
6371
6376
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6379,18 +6384,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1",
|
|
|
6379
6384
|
}] }, { type: Router, decorators: [{
|
|
6380
6385
|
type: Optional
|
|
6381
6386
|
}] }]; } });
|
|
6382
|
-
function
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
+
function provideRouterScroller() {
|
|
6388
|
+
return {
|
|
6389
|
+
provide: ROUTER_SCROLLER,
|
|
6390
|
+
useFactory: () => {
|
|
6391
|
+
const router = inject(Router);
|
|
6392
|
+
const viewportScroller = inject(ViewportScroller);
|
|
6393
|
+
const config = inject(ROUTER_CONFIGURATION);
|
|
6394
|
+
if (config.scrollOffset) {
|
|
6395
|
+
viewportScroller.setOffset(config.scrollOffset);
|
|
6396
|
+
}
|
|
6397
|
+
return new RouterScroller(router, viewportScroller, config);
|
|
6398
|
+
},
|
|
6399
|
+
};
|
|
6400
|
+
}
|
|
6401
|
+
function provideHashLocationStrategy() {
|
|
6402
|
+
return { provide: LocationStrategy, useClass: HashLocationStrategy };
|
|
6387
6403
|
}
|
|
6388
|
-
function
|
|
6389
|
-
return
|
|
6390
|
-
new PathLocationStrategy(platformLocationStrategy, baseHref);
|
|
6404
|
+
function providePathLocationStrategy() {
|
|
6405
|
+
return { provide: LocationStrategy, useClass: PathLocationStrategy };
|
|
6391
6406
|
}
|
|
6392
6407
|
function provideForRootGuard(router) {
|
|
6393
|
-
if (
|
|
6408
|
+
if (NG_DEV_MODE && router) {
|
|
6394
6409
|
throw new Error(`RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
|
|
6395
6410
|
}
|
|
6396
6411
|
return 'guarded';
|
|
@@ -6427,16 +6442,6 @@ function setupRouter(urlSerializer, contexts, location, injector, compiler, conf
|
|
|
6427
6442
|
}
|
|
6428
6443
|
router.titleStrategy = titleStrategy ?? defaultTitleStrategy;
|
|
6429
6444
|
assignExtraOptionsToRouter(opts, router);
|
|
6430
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && opts.enableTracing) {
|
|
6431
|
-
router.events.subscribe((e) => {
|
|
6432
|
-
// tslint:disable:no-console
|
|
6433
|
-
console.group?.(`Router Event: ${e.constructor.name}`);
|
|
6434
|
-
console.log(stringifyEvent(e));
|
|
6435
|
-
console.log(e);
|
|
6436
|
-
console.groupEnd?.();
|
|
6437
|
-
// tslint:enable:no-console
|
|
6438
|
-
});
|
|
6439
|
-
}
|
|
6440
6445
|
return router;
|
|
6441
6446
|
}
|
|
6442
6447
|
function assignExtraOptionsToRouter(opts, router) {
|
|
@@ -6465,112 +6470,136 @@ function assignExtraOptionsToRouter(opts, router) {
|
|
|
6465
6470
|
function rootRoute(router) {
|
|
6466
6471
|
return router.routerState.root;
|
|
6467
6472
|
}
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
* a resolver or a guard executes asynchronously.
|
|
6473
|
-
*
|
|
6474
|
-
* Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
|
|
6475
|
-
* `afterPreactivation` hook provided by the router.
|
|
6476
|
-
* The router navigation starts, reaches the point when preactivation is done, and then
|
|
6477
|
-
* pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
|
|
6478
|
-
*/
|
|
6479
|
-
class RouterInitializer {
|
|
6480
|
-
constructor(injector) {
|
|
6481
|
-
this.injector = injector;
|
|
6482
|
-
this.initNavigation = false;
|
|
6483
|
-
this.destroyed = false;
|
|
6484
|
-
this.resultOfPreactivationDone = new Subject();
|
|
6485
|
-
}
|
|
6486
|
-
appInitializer() {
|
|
6487
|
-
const p = this.injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6488
|
-
return p.then(() => {
|
|
6489
|
-
// If the injector was destroyed, the DI lookups below will fail.
|
|
6490
|
-
if (this.destroyed) {
|
|
6491
|
-
return Promise.resolve(true);
|
|
6492
|
-
}
|
|
6493
|
-
let resolve = null;
|
|
6494
|
-
const res = new Promise(r => resolve = r);
|
|
6495
|
-
const router = this.injector.get(Router);
|
|
6496
|
-
const opts = this.injector.get(ROUTER_CONFIGURATION);
|
|
6497
|
-
if (opts.initialNavigation === 'disabled') {
|
|
6498
|
-
router.setUpLocationChangeListener();
|
|
6499
|
-
resolve(true);
|
|
6500
|
-
}
|
|
6501
|
-
else if (opts.initialNavigation === 'enabledBlocking') {
|
|
6502
|
-
router.afterPreactivation = () => {
|
|
6503
|
-
// only the initial navigation should be delayed
|
|
6504
|
-
if (!this.initNavigation) {
|
|
6505
|
-
this.initNavigation = true;
|
|
6506
|
-
resolve(true);
|
|
6507
|
-
return this.resultOfPreactivationDone;
|
|
6508
|
-
// subsequent navigations should not be delayed
|
|
6509
|
-
}
|
|
6510
|
-
else {
|
|
6511
|
-
return of(void 0);
|
|
6512
|
-
}
|
|
6513
|
-
};
|
|
6514
|
-
router.initialNavigation();
|
|
6515
|
-
}
|
|
6516
|
-
else {
|
|
6517
|
-
resolve(true);
|
|
6518
|
-
}
|
|
6519
|
-
return res;
|
|
6520
|
-
});
|
|
6521
|
-
}
|
|
6522
|
-
bootstrapListener(bootstrappedComponentRef) {
|
|
6523
|
-
const opts = this.injector.get(ROUTER_CONFIGURATION);
|
|
6524
|
-
const preloader = this.injector.get(RouterPreloader);
|
|
6525
|
-
const routerScroller = this.injector.get(RouterScroller);
|
|
6526
|
-
const router = this.injector.get(Router);
|
|
6527
|
-
const ref = this.injector.get(ApplicationRef);
|
|
6473
|
+
function getBootstrapListener() {
|
|
6474
|
+
const injector = inject(Injector);
|
|
6475
|
+
return (bootstrappedComponentRef) => {
|
|
6476
|
+
const ref = injector.get(ApplicationRef);
|
|
6528
6477
|
if (bootstrappedComponentRef !== ref.components[0]) {
|
|
6529
6478
|
return;
|
|
6530
6479
|
}
|
|
6480
|
+
const router = injector.get(Router);
|
|
6481
|
+
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6531
6482
|
// Default case
|
|
6532
|
-
if (
|
|
6483
|
+
if (injector.get(INITIAL_NAVIGATION, null, InjectFlags.Optional) === null) {
|
|
6533
6484
|
router.initialNavigation();
|
|
6534
6485
|
}
|
|
6535
|
-
|
|
6536
|
-
|
|
6486
|
+
injector.get(ROUTER_PRELOADER, null, InjectFlags.Optional)?.setUpPreloading();
|
|
6487
|
+
injector.get(ROUTER_SCROLLER, null, InjectFlags.Optional)?.init();
|
|
6537
6488
|
router.resetRootComponentType(ref.componentTypes[0]);
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
}
|
|
6541
|
-
ngOnDestroy() {
|
|
6542
|
-
this.destroyed = true;
|
|
6543
|
-
}
|
|
6544
|
-
}
|
|
6545
|
-
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 });
|
|
6546
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.1", ngImport: i0, type: RouterInitializer });
|
|
6547
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.1", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6548
|
-
type: Injectable
|
|
6549
|
-
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6550
|
-
function getAppInitializer(r) {
|
|
6551
|
-
return r.appInitializer.bind(r);
|
|
6552
|
-
}
|
|
6553
|
-
function getBootstrapListener(r) {
|
|
6554
|
-
return r.bootstrapListener.bind(r);
|
|
6489
|
+
bootstrapDone.next();
|
|
6490
|
+
bootstrapDone.complete();
|
|
6491
|
+
};
|
|
6555
6492
|
}
|
|
6493
|
+
// TODO(atscott): This should not be in the public API
|
|
6556
6494
|
/**
|
|
6557
6495
|
* A [DI token](guide/glossary/#di-token) for the router initializer that
|
|
6558
6496
|
* is called after the app is bootstrapped.
|
|
6559
6497
|
*
|
|
6560
6498
|
* @publicApi
|
|
6561
6499
|
*/
|
|
6562
|
-
const ROUTER_INITIALIZER = new InjectionToken('Router Initializer');
|
|
6500
|
+
const ROUTER_INITIALIZER = new InjectionToken(NG_DEV_MODE ? 'Router Initializer' : '');
|
|
6501
|
+
function provideInitialNavigation(config) {
|
|
6502
|
+
return [
|
|
6503
|
+
config.initialNavigation === 'disabled' ? provideDisabledInitialNavigation() : [],
|
|
6504
|
+
config.initialNavigation === 'enabledBlocking' ? provideEnabledBlockingInitialNavigation() : [],
|
|
6505
|
+
];
|
|
6506
|
+
}
|
|
6563
6507
|
function provideRouterInitializer() {
|
|
6564
6508
|
return [
|
|
6565
|
-
|
|
6509
|
+
// ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just
|
|
6510
|
+
// have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.
|
|
6511
|
+
{ provide: ROUTER_INITIALIZER, useFactory: getBootstrapListener },
|
|
6512
|
+
{ provide: APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER },
|
|
6513
|
+
];
|
|
6514
|
+
}
|
|
6515
|
+
/**
|
|
6516
|
+
* A subject used to indicate that the bootstrapping phase is done. When initial navigation is
|
|
6517
|
+
* `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing
|
|
6518
|
+
* to the activation phase.
|
|
6519
|
+
*/
|
|
6520
|
+
const BOOTSTRAP_DONE = new InjectionToken(NG_DEV_MODE ? 'bootstrap done indicator' : '', {
|
|
6521
|
+
factory: () => {
|
|
6522
|
+
return new Subject();
|
|
6523
|
+
}
|
|
6524
|
+
});
|
|
6525
|
+
function provideEnabledBlockingInitialNavigation() {
|
|
6526
|
+
return [
|
|
6527
|
+
{ provide: INITIAL_NAVIGATION, useValue: 'enabledBlocking' },
|
|
6566
6528
|
{
|
|
6567
6529
|
provide: APP_INITIALIZER,
|
|
6568
6530
|
multi: true,
|
|
6569
|
-
|
|
6570
|
-
|
|
6531
|
+
deps: [Injector],
|
|
6532
|
+
useFactory: (injector) => {
|
|
6533
|
+
const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
|
|
6534
|
+
let initNavigation = false;
|
|
6535
|
+
return () => {
|
|
6536
|
+
return locationInitialized.then(() => {
|
|
6537
|
+
return new Promise(resolve => {
|
|
6538
|
+
const router = injector.get(Router);
|
|
6539
|
+
const bootstrapDone = injector.get(BOOTSTRAP_DONE);
|
|
6540
|
+
router.afterPreactivation = () => {
|
|
6541
|
+
// only the initial navigation should be delayed
|
|
6542
|
+
if (!initNavigation) {
|
|
6543
|
+
initNavigation = true;
|
|
6544
|
+
resolve(true);
|
|
6545
|
+
return bootstrapDone;
|
|
6546
|
+
// subsequent navigations should not be delayed
|
|
6547
|
+
}
|
|
6548
|
+
else {
|
|
6549
|
+
return of(void 0);
|
|
6550
|
+
}
|
|
6551
|
+
};
|
|
6552
|
+
router.initialNavigation();
|
|
6553
|
+
});
|
|
6554
|
+
});
|
|
6555
|
+
};
|
|
6556
|
+
}
|
|
6571
6557
|
},
|
|
6572
|
-
|
|
6573
|
-
|
|
6558
|
+
];
|
|
6559
|
+
}
|
|
6560
|
+
const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE ? 'initial navigation' : '');
|
|
6561
|
+
function provideDisabledInitialNavigation() {
|
|
6562
|
+
return [
|
|
6563
|
+
{
|
|
6564
|
+
provide: APP_INITIALIZER,
|
|
6565
|
+
multi: true,
|
|
6566
|
+
useFactory: () => {
|
|
6567
|
+
const router = inject(Router);
|
|
6568
|
+
return () => {
|
|
6569
|
+
router.setUpLocationChangeListener();
|
|
6570
|
+
};
|
|
6571
|
+
}
|
|
6572
|
+
},
|
|
6573
|
+
{ provide: INITIAL_NAVIGATION, useValue: 'disabled' }
|
|
6574
|
+
];
|
|
6575
|
+
}
|
|
6576
|
+
function provideTracing() {
|
|
6577
|
+
if (NG_DEV_MODE) {
|
|
6578
|
+
return [{
|
|
6579
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
6580
|
+
multi: true,
|
|
6581
|
+
useFactory: () => {
|
|
6582
|
+
const router = inject(Router);
|
|
6583
|
+
return () => router.events.subscribe((e) => {
|
|
6584
|
+
// tslint:disable:no-console
|
|
6585
|
+
console.group?.(`Router Event: ${e.constructor.name}`);
|
|
6586
|
+
console.log(stringifyEvent(e));
|
|
6587
|
+
console.log(e);
|
|
6588
|
+
console.groupEnd?.();
|
|
6589
|
+
// tslint:enable:no-console
|
|
6590
|
+
});
|
|
6591
|
+
}
|
|
6592
|
+
}];
|
|
6593
|
+
}
|
|
6594
|
+
else {
|
|
6595
|
+
return [];
|
|
6596
|
+
}
|
|
6597
|
+
}
|
|
6598
|
+
function providePreloading(preloadingStrategy) {
|
|
6599
|
+
return [
|
|
6600
|
+
RouterPreloader,
|
|
6601
|
+
{ provide: ROUTER_PRELOADER, useExisting: RouterPreloader },
|
|
6602
|
+
{ provide: PreloadingStrategy, useExisting: preloadingStrategy },
|
|
6574
6603
|
];
|
|
6575
6604
|
}
|
|
6576
6605
|
|
|
@@ -6584,7 +6613,7 @@ function provideRouterInitializer() {
|
|
|
6584
6613
|
/**
|
|
6585
6614
|
* @publicApi
|
|
6586
6615
|
*/
|
|
6587
|
-
const VERSION = new Version('14.1.0-next.
|
|
6616
|
+
const VERSION = new Version('14.1.0-next.2');
|
|
6588
6617
|
|
|
6589
6618
|
/**
|
|
6590
6619
|
* @license
|
|
@@ -6623,5 +6652,5 @@ const VERSION = new Version('14.1.0-next.1');
|
|
|
6623
6652
|
* Generated bundle index. Do not edit.
|
|
6624
6653
|
*/
|
|
6625
6654
|
|
|
6626
|
-
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 };
|
|
6655
|
+
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 };
|
|
6627
6656
|
//# sourceMappingURL=router.mjs.map
|