@angular/router 14.0.0-next.14 → 14.0.0-next.15
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 +4 -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 +22 -4
- package/esm2020/src/directives/router_outlet.mjs +5 -5
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/page_title_strategy.mjs +3 -3
- package/esm2020/src/recognize.mjs +3 -3
- package/esm2020/src/router.mjs +36 -23
- package/esm2020/src/router_config_loader.mjs +61 -25
- package/esm2020/src/router_module.mjs +7 -7
- package/esm2020/src/router_preloader.mjs +30 -21
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/utils/config.mjs +28 -11
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +4 -4
- package/fesm2015/router.mjs +205 -110
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -5
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +201 -109
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -5
- package/fesm2020/upgrade.mjs +1 -1
- package/{router.d.ts → index.d.ts} +3808 -3774
- package/package.json +8 -8
- package/testing/{testing.d.ts → index.d.ts} +65 -64
- package/upgrade/{upgrade.d.ts → index.d.ts} +51 -50
- package/testing/package.json +0 -9
- package/upgrade/package.json +0 -10
package/fesm2015/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.15
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -101,9 +101,9 @@ class RouterTestingModule {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
105
|
-
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
106
|
-
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
104
|
+
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
105
|
+
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
|
|
106
|
+
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterTestingModule, providers: [
|
|
107
107
|
ɵROUTER_PROVIDERS,
|
|
108
108
|
EXTRA_ROUTER_TESTING_PROVIDERS,
|
|
109
109
|
{ provide: Location, useClass: SpyLocation },
|
|
@@ -128,7 +128,7 @@ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
|
|
|
128
128
|
{ provide: PreloadingStrategy, useExisting: NoPreloading },
|
|
129
129
|
provideRoutes([]),
|
|
130
130
|
], imports: [RouterModule] });
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterTestingModule, decorators: [{
|
|
132
132
|
type: NgModule,
|
|
133
133
|
args: [{
|
|
134
134
|
exports: [RouterModule],
|
package/fesm2015/upgrade.mjs
CHANGED
package/fesm2020/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.15
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import * as i3 from '@angular/common';
|
|
8
8
|
import { Location, LocationStrategy, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, ComponentFactoryResolver, createEnvironmentInjector, 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, ApplicationRef, Version } from '@angular/core';
|
|
10
|
+
import { ɵisObservable, ɵisPromise, EventEmitter, Directive, Attribute, Output, Component, ɵisStandalone, ComponentFactoryResolver, createEnvironmentInjector, 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, ApplicationRef, Version } from '@angular/core';
|
|
11
11
|
import { from, of, BehaviorSubject, combineLatest, throwError, EmptyError, concat, defer, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
12
|
-
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, mapTo, finalize, refCount, mergeAll } from 'rxjs/operators';
|
|
12
|
+
import { map, switchMap, take, startWith, scan, filter, catchError, concatMap, last as last$1, first, mergeMap, tap, takeLast, mapTo, finalize, refCount, defaultIfEmpty, mergeAll } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@angular/platform-browser';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -2255,7 +2255,7 @@ class RouterOutlet {
|
|
|
2255
2255
|
this._activatedRoute = activatedRoute;
|
|
2256
2256
|
const location = this.location;
|
|
2257
2257
|
const snapshot = activatedRoute._futureSnapshot;
|
|
2258
|
-
const component = snapshot.
|
|
2258
|
+
const component = snapshot.component;
|
|
2259
2259
|
const childContexts = this.parentContexts.getOrCreateContext(this.name).children;
|
|
2260
2260
|
const injector = new OutletInjector(activatedRoute, childContexts, location.injector);
|
|
2261
2261
|
if (resolverOrInjector && isComponentFactoryResolver(resolverOrInjector)) {
|
|
@@ -2272,9 +2272,9 @@ class RouterOutlet {
|
|
|
2272
2272
|
this.activateEvents.emit(this.activated.instance);
|
|
2273
2273
|
}
|
|
2274
2274
|
}
|
|
2275
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2276
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2275
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2276
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.15", type: RouterOutlet, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
|
|
2277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2278
2278
|
type: Directive,
|
|
2279
2279
|
args: [{ selector: 'router-outlet', exportAs: 'outlet' }]
|
|
2280
2280
|
}], ctorParameters: function () { return [{ type: ChildrenOutletContexts }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
@@ -2331,9 +2331,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2331
2331
|
*/
|
|
2332
2332
|
class ɵEmptyOutletComponent {
|
|
2333
2333
|
}
|
|
2334
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2335
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
2334
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2335
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "14.0.0-next.15", 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"] }] });
|
|
2336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2337
2337
|
type: Component,
|
|
2338
2338
|
args: [{ template: `<router-outlet></router-outlet>` }]
|
|
2339
2339
|
}] });
|
|
@@ -2351,18 +2351,26 @@ function getLoadedRoutes(route) {
|
|
|
2351
2351
|
function getLoadedInjector(route) {
|
|
2352
2352
|
return route._loadedInjector;
|
|
2353
2353
|
}
|
|
2354
|
+
function getLoadedComponent(route) {
|
|
2355
|
+
return route._loadedComponent;
|
|
2356
|
+
}
|
|
2354
2357
|
function getProvidersInjector(route) {
|
|
2355
2358
|
return route._injector;
|
|
2356
2359
|
}
|
|
2357
|
-
function validateConfig(config, parentPath = '') {
|
|
2360
|
+
function validateConfig(config, parentPath = '', requireStandaloneComponents = false) {
|
|
2358
2361
|
// forEach doesn't iterate undefined values
|
|
2359
2362
|
for (let i = 0; i < config.length; i++) {
|
|
2360
2363
|
const route = config[i];
|
|
2361
2364
|
const fullPath = getFullPath(parentPath, route);
|
|
2362
|
-
validateNode(route, fullPath);
|
|
2365
|
+
validateNode(route, fullPath, requireStandaloneComponents);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
function assertStandalone(fullPath, component) {
|
|
2369
|
+
if (component && !ɵisStandalone(component)) {
|
|
2370
|
+
throw new Error(`Invalid configuration of route '${fullPath}'. The component must be standalone.`);
|
|
2363
2371
|
}
|
|
2364
2372
|
}
|
|
2365
|
-
function validateNode(route, fullPath) {
|
|
2373
|
+
function validateNode(route, fullPath, requireStandaloneComponents) {
|
|
2366
2374
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2367
2375
|
if (!route) {
|
|
2368
2376
|
throw new Error(`
|
|
@@ -2380,7 +2388,7 @@ function validateNode(route, fullPath) {
|
|
|
2380
2388
|
if (Array.isArray(route)) {
|
|
2381
2389
|
throw new Error(`Invalid configuration of route '${fullPath}': Array cannot be specified`);
|
|
2382
2390
|
}
|
|
2383
|
-
if (!route.component && !route.children && !route.loadChildren &&
|
|
2391
|
+
if (!route.component && !route.loadComponent && !route.children && !route.loadChildren &&
|
|
2384
2392
|
(route.outlet && route.outlet !== PRIMARY_OUTLET)) {
|
|
2385
2393
|
throw new Error(`Invalid configuration of route '${fullPath}': a componentless route without children or loadChildren cannot have a named outlet set`);
|
|
2386
2394
|
}
|
|
@@ -2393,8 +2401,11 @@ function validateNode(route, fullPath) {
|
|
|
2393
2401
|
if (route.children && route.loadChildren) {
|
|
2394
2402
|
throw new Error(`Invalid configuration of route '${fullPath}': children and loadChildren cannot be used together`);
|
|
2395
2403
|
}
|
|
2396
|
-
if (route.redirectTo && route.component) {
|
|
2397
|
-
throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and component cannot be used together`);
|
|
2404
|
+
if (route.redirectTo && (route.component || route.loadComponent)) {
|
|
2405
|
+
throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and component/loadComponent cannot be used together`);
|
|
2406
|
+
}
|
|
2407
|
+
if (route.component && route.loadComponent) {
|
|
2408
|
+
throw new Error(`Invalid configuration of route '${fullPath}': component and loadComponent cannot be used together`);
|
|
2398
2409
|
}
|
|
2399
2410
|
if (route.redirectTo && route.canActivate) {
|
|
2400
2411
|
throw new Error(`Invalid configuration of route '${fullPath}': redirectTo and canActivate cannot be used together. Redirects happen before activation ` +
|
|
@@ -2403,8 +2414,9 @@ function validateNode(route, fullPath) {
|
|
|
2403
2414
|
if (route.path && route.matcher) {
|
|
2404
2415
|
throw new Error(`Invalid configuration of route '${fullPath}': path and matcher cannot be used together`);
|
|
2405
2416
|
}
|
|
2406
|
-
if (route.redirectTo === void 0 && !route.component && !route.
|
|
2407
|
-
|
|
2417
|
+
if (route.redirectTo === void 0 && !route.component && !route.loadComponent &&
|
|
2418
|
+
!route.children && !route.loadChildren) {
|
|
2419
|
+
throw new Error(`Invalid configuration of route '${fullPath}'. One of the following must be provided: component, loadComponent, redirectTo, children or loadChildren`);
|
|
2408
2420
|
}
|
|
2409
2421
|
if (route.path === void 0 && route.matcher === void 0) {
|
|
2410
2422
|
throw new Error(`Invalid configuration of route '${fullPath}': routes must have either a path or a matcher specified`);
|
|
@@ -2416,9 +2428,12 @@ function validateNode(route, fullPath) {
|
|
|
2416
2428
|
const exp = `The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`;
|
|
2417
2429
|
throw new Error(`Invalid configuration of route '{path: "${fullPath}", redirectTo: "${route.redirectTo}"}': please provide 'pathMatch'. ${exp}`);
|
|
2418
2430
|
}
|
|
2431
|
+
if (requireStandaloneComponents) {
|
|
2432
|
+
assertStandalone(fullPath, route.component);
|
|
2433
|
+
}
|
|
2419
2434
|
}
|
|
2420
2435
|
if (route.children) {
|
|
2421
|
-
validateConfig(route.children, fullPath);
|
|
2436
|
+
validateConfig(route.children, fullPath, requireStandaloneComponents);
|
|
2422
2437
|
}
|
|
2423
2438
|
}
|
|
2424
2439
|
function getFullPath(parentPath, currentRoute) {
|
|
@@ -2444,7 +2459,8 @@ function getFullPath(parentPath, currentRoute) {
|
|
|
2444
2459
|
function standardizeConfig(r) {
|
|
2445
2460
|
const children = r.children && r.children.map(standardizeConfig);
|
|
2446
2461
|
const c = children ? { ...r, children } : { ...r };
|
|
2447
|
-
if (!c.component &&
|
|
2462
|
+
if ((!c.component && !c.loadComponent) && (children || c.loadChildren) &&
|
|
2463
|
+
(c.outlet && c.outlet !== PRIMARY_OUTLET)) {
|
|
2448
2464
|
c.component = ɵEmptyOutletComponent;
|
|
2449
2465
|
}
|
|
2450
2466
|
return c;
|
|
@@ -3098,7 +3114,7 @@ class ApplyRedirects {
|
|
|
3098
3114
|
if (route.loadChildren) {
|
|
3099
3115
|
const loaded$ = route._loadedRoutes ?
|
|
3100
3116
|
of({ routes: route._loadedRoutes, injector: route._loadedInjector }) :
|
|
3101
|
-
this.configLoader.
|
|
3117
|
+
this.configLoader.loadChildren(injector, route);
|
|
3102
3118
|
return loaded$.pipe(map((cfg) => {
|
|
3103
3119
|
route._loadedRoutes = cfg.routes;
|
|
3104
3120
|
route._loadedInjector = cfg.injector;
|
|
@@ -3142,10 +3158,10 @@ class ApplyRedirects {
|
|
|
3142
3158
|
return this.runCanLoadGuards(injector, route, segments)
|
|
3143
3159
|
.pipe(mergeMap((shouldLoadResult) => {
|
|
3144
3160
|
if (shouldLoadResult) {
|
|
3145
|
-
return this.configLoader.
|
|
3161
|
+
return this.configLoader.loadChildren(injector, route)
|
|
3162
|
+
.pipe(tap((cfg) => {
|
|
3146
3163
|
route._loadedRoutes = cfg.routes;
|
|
3147
3164
|
route._loadedInjector = cfg.injector;
|
|
3148
|
-
return cfg;
|
|
3149
3165
|
}));
|
|
3150
3166
|
}
|
|
3151
3167
|
return canLoadFails(route);
|
|
@@ -3686,7 +3702,7 @@ class Recognizer {
|
|
|
3686
3702
|
if (route.path === '**') {
|
|
3687
3703
|
const params = segments.length > 0 ? last(segments).parameters : {};
|
|
3688
3704
|
const pathIndexShift = getPathIndexShift(rawSegment) + segments.length;
|
|
3689
|
-
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route),
|
|
3705
|
+
snapshot = new ActivatedRouteSnapshot(segments, params, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component ?? route._loadedComponent ?? null, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route),
|
|
3690
3706
|
// NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
|
|
3691
3707
|
// production bundle size. This value is intended only to surface a warning to users
|
|
3692
3708
|
// depending on `relativeLinkResolution: 'legacy'` in dev mode.
|
|
@@ -3701,7 +3717,7 @@ class Recognizer {
|
|
|
3701
3717
|
consumedSegments = result.consumedSegments;
|
|
3702
3718
|
remainingSegments = result.remainingSegments;
|
|
3703
3719
|
const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
|
|
3704
|
-
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.parameters, Object.freeze({ ...this.urlTree.queryParams }), this.urlTree.fragment, getData(route), getOutlet(route), route.component, route, getSourceSegmentGroup(rawSegment), pathIndexShift, getResolve(route), (NG_DEV_MODE$2 ? getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
3720
|
+
snapshot = new ActivatedRouteSnapshot(consumedSegments, result.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$2 ? getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
|
|
3705
3721
|
pathIndexShift));
|
|
3706
3722
|
}
|
|
3707
3723
|
const childConfig = getChildConfig(route);
|
|
@@ -4021,11 +4037,37 @@ class RouterConfigLoader {
|
|
|
4021
4037
|
constructor(injector, compiler) {
|
|
4022
4038
|
this.injector = injector;
|
|
4023
4039
|
this.compiler = compiler;
|
|
4024
|
-
this.
|
|
4040
|
+
this.componentLoaders = new WeakMap();
|
|
4041
|
+
this.childrenLoaders = new WeakMap();
|
|
4042
|
+
}
|
|
4043
|
+
loadComponent(route) {
|
|
4044
|
+
if (this.componentLoaders.get(route)) {
|
|
4045
|
+
return this.componentLoaders.get(route);
|
|
4046
|
+
}
|
|
4047
|
+
else if (route._loadedComponent) {
|
|
4048
|
+
return of(route._loadedComponent);
|
|
4049
|
+
}
|
|
4050
|
+
if (this.onLoadStartListener) {
|
|
4051
|
+
this.onLoadStartListener(route);
|
|
4052
|
+
}
|
|
4053
|
+
const loadRunner = wrapIntoObservable(route.loadComponent())
|
|
4054
|
+
.pipe(tap(component => {
|
|
4055
|
+
if (this.onLoadEndListener) {
|
|
4056
|
+
this.onLoadEndListener(route);
|
|
4057
|
+
}
|
|
4058
|
+
NG_DEV_MODE$1 && assertStandalone(route.path ?? '', component);
|
|
4059
|
+
route._loadedComponent = component;
|
|
4060
|
+
}), finalize(() => {
|
|
4061
|
+
this.componentLoaders.delete(route);
|
|
4062
|
+
}));
|
|
4063
|
+
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4064
|
+
const loader = new ConnectableObservable(loadRunner, () => new Subject()).pipe(refCount());
|
|
4065
|
+
this.componentLoaders.set(route, loader);
|
|
4066
|
+
return loader;
|
|
4025
4067
|
}
|
|
4026
|
-
|
|
4027
|
-
if (this.
|
|
4028
|
-
return this.
|
|
4068
|
+
loadChildren(parentInjector, route) {
|
|
4069
|
+
if (this.childrenLoaders.get(route)) {
|
|
4070
|
+
return this.childrenLoaders.get(route);
|
|
4029
4071
|
}
|
|
4030
4072
|
else if (route._loadedRoutes) {
|
|
4031
4073
|
return of({ routes: route._loadedRoutes, injector: route._loadedInjector });
|
|
@@ -4033,33 +4075,43 @@ class RouterConfigLoader {
|
|
|
4033
4075
|
if (this.onLoadStartListener) {
|
|
4034
4076
|
this.onLoadStartListener(route);
|
|
4035
4077
|
}
|
|
4036
|
-
const
|
|
4037
|
-
const loadRunner =
|
|
4078
|
+
const moduleFactoryOrRoutes$ = this.loadModuleFactoryOrRoutes(route.loadChildren);
|
|
4079
|
+
const loadRunner = moduleFactoryOrRoutes$.pipe(map((factoryOrRoutes) => {
|
|
4038
4080
|
if (this.onLoadEndListener) {
|
|
4039
4081
|
this.onLoadEndListener(route);
|
|
4040
4082
|
}
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4083
|
+
// This injector comes from the `NgModuleRef` when lazy loading an `NgModule`. There is no
|
|
4084
|
+
// injector associated with lazy loading a `Route` array.
|
|
4085
|
+
let injector;
|
|
4086
|
+
let rawRoutes;
|
|
4087
|
+
let requireStandaloneComponents = false;
|
|
4088
|
+
if (Array.isArray(factoryOrRoutes)) {
|
|
4089
|
+
rawRoutes = factoryOrRoutes;
|
|
4090
|
+
requireStandaloneComponents = true;
|
|
4091
|
+
}
|
|
4092
|
+
else {
|
|
4093
|
+
injector = factoryOrRoutes.create(parentInjector).injector;
|
|
4094
|
+
// When loading a module that doesn't provide `RouterModule.forChild()` preloader
|
|
4095
|
+
// will get stuck in an infinite loop. The child module's Injector will look to
|
|
4096
|
+
// its parent `Injector` when it doesn't find any ROUTES so it will return routes
|
|
4097
|
+
// for it's parent module instead.
|
|
4098
|
+
rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
|
|
4099
|
+
}
|
|
4100
|
+
const routes = rawRoutes.map(standardizeConfig);
|
|
4101
|
+
NG_DEV_MODE$1 && validateConfig(routes, route.path, requireStandaloneComponents);
|
|
4050
4102
|
return { routes, injector };
|
|
4051
4103
|
}), finalize(() => {
|
|
4052
|
-
this.
|
|
4104
|
+
this.childrenLoaders.delete(route);
|
|
4053
4105
|
}));
|
|
4054
4106
|
// Use custom ConnectableObservable as share in runners pipe increasing the bundle size too much
|
|
4055
4107
|
const loader = new ConnectableObservable(loadRunner, () => new Subject())
|
|
4056
4108
|
.pipe(refCount());
|
|
4057
|
-
this.
|
|
4109
|
+
this.childrenLoaders.set(route, loader);
|
|
4058
4110
|
return loader;
|
|
4059
4111
|
}
|
|
4060
|
-
|
|
4112
|
+
loadModuleFactoryOrRoutes(loadChildren) {
|
|
4061
4113
|
return wrapIntoObservable(loadChildren()).pipe(mergeMap((t) => {
|
|
4062
|
-
if (t instanceof NgModuleFactory) {
|
|
4114
|
+
if (t instanceof NgModuleFactory || Array.isArray(t)) {
|
|
4063
4115
|
return of(t);
|
|
4064
4116
|
}
|
|
4065
4117
|
else {
|
|
@@ -4068,9 +4120,9 @@ class RouterConfigLoader {
|
|
|
4068
4120
|
}));
|
|
4069
4121
|
}
|
|
4070
4122
|
}
|
|
4071
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4072
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4073
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
4123
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4124
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterConfigLoader });
|
|
4125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4074
4126
|
type: Injectable
|
|
4075
4127
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4076
4128
|
|
|
@@ -4503,6 +4555,25 @@ class Router {
|
|
|
4503
4555
|
skipLocationChange: !!skipLocationChange,
|
|
4504
4556
|
replaceUrl: !!replaceUrl,
|
|
4505
4557
|
});
|
|
4558
|
+
}),
|
|
4559
|
+
// --- LOAD COMPONENTS ---
|
|
4560
|
+
switchTap((t) => {
|
|
4561
|
+
const loadComponents = (route) => {
|
|
4562
|
+
const loaders = [];
|
|
4563
|
+
if (route.routeConfig?.loadComponent &&
|
|
4564
|
+
!route.routeConfig._loadedComponent) {
|
|
4565
|
+
loaders.push(this.configLoader.loadComponent(route.routeConfig)
|
|
4566
|
+
.pipe(tap(loadedComponent => {
|
|
4567
|
+
route.component = loadedComponent;
|
|
4568
|
+
}), map(() => void 0)));
|
|
4569
|
+
}
|
|
4570
|
+
for (const child of route.children) {
|
|
4571
|
+
loaders.push(...loadComponents(child));
|
|
4572
|
+
}
|
|
4573
|
+
return loaders;
|
|
4574
|
+
};
|
|
4575
|
+
return combineLatest(loadComponents(t.targetSnapshot.root))
|
|
4576
|
+
.pipe(defaultIfEmpty(), take(1));
|
|
4506
4577
|
}), map((t) => {
|
|
4507
4578
|
const targetRouterState = createRouterState(this.routeReuseStrategy, t.targetSnapshot, t.currentRouterState);
|
|
4508
4579
|
return ({ ...t, targetRouterState });
|
|
@@ -4581,23 +4652,17 @@ class Router {
|
|
|
4581
4652
|
t.resolve(false);
|
|
4582
4653
|
}
|
|
4583
4654
|
else {
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
// the navigation is rejected.
|
|
4596
|
-
replaceUrl: this.urlUpdateStrategy === 'eager' ||
|
|
4597
|
-
isBrowserTriggeredNavigation(t.source)
|
|
4598
|
-
};
|
|
4599
|
-
this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
|
|
4600
|
-
}, 0);
|
|
4655
|
+
const mergedTree = this.urlHandlingStrategy.merge(e.url, this.rawUrlTree);
|
|
4656
|
+
const extras = {
|
|
4657
|
+
skipLocationChange: t.extras.skipLocationChange,
|
|
4658
|
+
// The URL is already updated at this point if we have 'eager' URL
|
|
4659
|
+
// updates or if the navigation was triggered by the browser (back
|
|
4660
|
+
// button, URL bar, etc). We want to replace that item in history if
|
|
4661
|
+
// the navigation is rejected.
|
|
4662
|
+
replaceUrl: this.urlUpdateStrategy === 'eager' ||
|
|
4663
|
+
isBrowserTriggeredNavigation(t.source)
|
|
4664
|
+
};
|
|
4665
|
+
this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
|
|
4601
4666
|
}
|
|
4602
4667
|
/* All other errors should reset to the router's internal URL reference to
|
|
4603
4668
|
* the pre-error state. */
|
|
@@ -5062,9 +5127,9 @@ class Router {
|
|
|
5062
5127
|
return { navigationId };
|
|
5063
5128
|
}
|
|
5064
5129
|
}
|
|
5065
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5066
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5067
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5130
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5131
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: Router });
|
|
5132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: Router, decorators: [{
|
|
5068
5133
|
type: Injectable
|
|
5069
5134
|
}], ctorParameters: function () { return [{ type: i0.Type }, { type: UrlSerializer }, { type: ChildrenOutletContexts }, { type: i3.Location }, { type: i0.Injector }, { type: i0.Compiler }, { type: undefined }]; } });
|
|
5070
5135
|
function validateCommands(commands) {
|
|
@@ -5263,9 +5328,9 @@ class RouterLink {
|
|
|
5263
5328
|
});
|
|
5264
5329
|
}
|
|
5265
5330
|
}
|
|
5266
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5267
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5331
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5332
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.15", 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 });
|
|
5333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterLink, decorators: [{
|
|
5269
5334
|
type: Directive,
|
|
5270
5335
|
args: [{ selector: ':not(a):not(area)[routerLink]' }]
|
|
5271
5336
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
@@ -5382,9 +5447,9 @@ class RouterLinkWithHref {
|
|
|
5382
5447
|
});
|
|
5383
5448
|
}
|
|
5384
5449
|
}
|
|
5385
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5386
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5450
|
+
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5451
|
+
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.15", 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 });
|
|
5452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
5388
5453
|
type: Directive,
|
|
5389
5454
|
args: [{ selector: 'a[routerLink],area[routerLink]' }]
|
|
5390
5455
|
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
@@ -5481,6 +5546,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14",
|
|
|
5481
5546
|
* </div>
|
|
5482
5547
|
* ```
|
|
5483
5548
|
*
|
|
5549
|
+
* The `RouterLinkActive` directive can also be used to set the aria-current attribute
|
|
5550
|
+
* to provide an alternative distinction for active elements to visually impaired users.
|
|
5551
|
+
*
|
|
5552
|
+
* For example, the following code adds the 'active' class to the Home Page link when it is
|
|
5553
|
+
* indeed active and in such case also sets its aria-current attribute to 'page':
|
|
5554
|
+
*
|
|
5555
|
+
* ```
|
|
5556
|
+
* <a routerLink="/" routerLinkActive="active" ariaCurrentWhenActive="page">Home Page</a>
|
|
5557
|
+
* ```
|
|
5558
|
+
*
|
|
5484
5559
|
* @ngModule RouterModule
|
|
5485
5560
|
*
|
|
5486
5561
|
* @publicApi
|
|
@@ -5574,6 +5649,12 @@ class RouterLinkActive {
|
|
|
5574
5649
|
this.renderer.removeClass(this.element.nativeElement, c);
|
|
5575
5650
|
}
|
|
5576
5651
|
});
|
|
5652
|
+
if (hasActiveLinks && this.ariaCurrentWhenActive !== undefined) {
|
|
5653
|
+
this.renderer.setAttribute(this.element.nativeElement, 'aria-current', this.ariaCurrentWhenActive.toString());
|
|
5654
|
+
}
|
|
5655
|
+
else {
|
|
5656
|
+
this.renderer.removeAttribute(this.element.nativeElement, 'aria-current');
|
|
5657
|
+
}
|
|
5577
5658
|
// Emit on isActiveChange after classes are updated
|
|
5578
5659
|
this.isActiveChange.emit(hasActiveLinks);
|
|
5579
5660
|
}
|
|
@@ -5593,9 +5674,9 @@ class RouterLinkActive {
|
|
|
5593
5674
|
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
5594
5675
|
}
|
|
5595
5676
|
}
|
|
5596
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5597
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5677
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", 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 });
|
|
5678
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.15", 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 });
|
|
5679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
5599
5680
|
type: Directive,
|
|
5600
5681
|
args: [{
|
|
5601
5682
|
selector: '[routerLinkActive]',
|
|
@@ -5613,6 +5694,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.14",
|
|
|
5613
5694
|
args: [RouterLinkWithHref, { descendants: true }]
|
|
5614
5695
|
}], routerLinkActiveOptions: [{
|
|
5615
5696
|
type: Input
|
|
5697
|
+
}], ariaCurrentWhenActive: [{
|
|
5698
|
+
type: Input
|
|
5616
5699
|
}], isActiveChange: [{
|
|
5617
5700
|
type: Output
|
|
5618
5701
|
}], routerLinkActive: [{
|
|
@@ -5696,9 +5779,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
5696
5779
|
}
|
|
5697
5780
|
}
|
|
5698
5781
|
}
|
|
5699
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5700
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5782
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5783
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
5784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
5702
5785
|
type: Injectable,
|
|
5703
5786
|
args: [{ providedIn: 'root' }]
|
|
5704
5787
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -5792,39 +5875,48 @@ class RouterPreloader {
|
|
|
5792
5875
|
}
|
|
5793
5876
|
const injectorForCurrentRoute = route._injector ?? injector;
|
|
5794
5877
|
const injectorForChildren = route._loadedInjector ?? injectorForCurrentRoute;
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
res.push(this.processRoutes(injectorForChildren, route._loadedRoutes));
|
|
5798
|
-
// no config loaded, fetch the config
|
|
5799
|
-
}
|
|
5800
|
-
else if (route.loadChildren && !route.canLoad) {
|
|
5878
|
+
if ((route.loadChildren && !route._loadedRoutes) ||
|
|
5879
|
+
(route.loadComponent && !route._loadedComponent)) {
|
|
5801
5880
|
res.push(this.preloadConfig(injectorForCurrentRoute, route));
|
|
5802
|
-
// recurse into children
|
|
5803
5881
|
}
|
|
5804
|
-
else if (route.children) {
|
|
5805
|
-
res.push(this.processRoutes(injectorForChildren, route.children));
|
|
5882
|
+
else if (route.children || route._loadedRoutes) {
|
|
5883
|
+
res.push(this.processRoutes(injectorForChildren, (route.children ?? route._loadedRoutes)));
|
|
5806
5884
|
}
|
|
5807
5885
|
}
|
|
5808
|
-
return from(res).pipe(mergeAll()
|
|
5886
|
+
return from(res).pipe(mergeAll());
|
|
5809
5887
|
}
|
|
5810
5888
|
preloadConfig(injector, route) {
|
|
5811
5889
|
return this.preloadingStrategy.preload(route, () => {
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
this.loader.
|
|
5815
|
-
|
|
5890
|
+
let loadedChildren$;
|
|
5891
|
+
if (route.loadChildren && route.canLoad === undefined) {
|
|
5892
|
+
loadedChildren$ = this.loader.loadChildren(injector, route);
|
|
5893
|
+
}
|
|
5894
|
+
else {
|
|
5895
|
+
loadedChildren$ = of(null);
|
|
5896
|
+
}
|
|
5897
|
+
const recursiveLoadChildren$ = loadedChildren$.pipe(mergeMap((config) => {
|
|
5898
|
+
if (config === null) {
|
|
5899
|
+
return of(void 0);
|
|
5900
|
+
}
|
|
5816
5901
|
route._loadedRoutes = config.routes;
|
|
5817
5902
|
route._loadedInjector = config.injector;
|
|
5818
|
-
// If the loaded config was a module, use that as the module/module injector going
|
|
5819
|
-
// Otherwise, continue using the current module/module injector.
|
|
5903
|
+
// If the loaded config was a module, use that as the module/module injector going
|
|
5904
|
+
// forward. Otherwise, continue using the current module/module injector.
|
|
5820
5905
|
return this.processRoutes(config.injector ?? injector, config.routes);
|
|
5821
5906
|
}));
|
|
5907
|
+
if (route.loadComponent && !route._loadedComponent) {
|
|
5908
|
+
const loadComponent$ = this.loader.loadComponent(route);
|
|
5909
|
+
return from([recursiveLoadChildren$, loadComponent$]).pipe(mergeAll());
|
|
5910
|
+
}
|
|
5911
|
+
else {
|
|
5912
|
+
return recursiveLoadChildren$;
|
|
5913
|
+
}
|
|
5822
5914
|
});
|
|
5823
5915
|
}
|
|
5824
5916
|
}
|
|
5825
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5826
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5827
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5917
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5918
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterPreloader });
|
|
5919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
5828
5920
|
type: Injectable
|
|
5829
5921
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
5830
5922
|
|
|
@@ -5910,9 +6002,9 @@ class RouterScroller {
|
|
|
5910
6002
|
}
|
|
5911
6003
|
}
|
|
5912
6004
|
}
|
|
5913
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5914
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
5915
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6005
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6006
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterScroller });
|
|
6007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterScroller, decorators: [{
|
|
5916
6008
|
type: Injectable
|
|
5917
6009
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
5918
6010
|
|
|
@@ -6054,10 +6146,10 @@ class RouterModule {
|
|
|
6054
6146
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
6055
6147
|
}
|
|
6056
6148
|
}
|
|
6057
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6058
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6059
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6060
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6149
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6150
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterModule, declarations: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6151
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterModule });
|
|
6152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterModule, decorators: [{
|
|
6061
6153
|
type: NgModule,
|
|
6062
6154
|
args: [{
|
|
6063
6155
|
declarations: ROUTER_DIRECTIVES,
|
|
@@ -6236,9 +6328,9 @@ class RouterInitializer {
|
|
|
6236
6328
|
this.destroyed = true;
|
|
6237
6329
|
}
|
|
6238
6330
|
}
|
|
6239
|
-
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6240
|
-
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
6331
|
+
RouterInitializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterInitializer, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6332
|
+
RouterInitializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterInitializer });
|
|
6333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.15", ngImport: i0, type: RouterInitializer, decorators: [{
|
|
6242
6334
|
type: Injectable
|
|
6243
6335
|
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
6244
6336
|
function getAppInitializer(r) {
|
|
@@ -6278,7 +6370,7 @@ function provideRouterInitializer() {
|
|
|
6278
6370
|
/**
|
|
6279
6371
|
* @publicApi
|
|
6280
6372
|
*/
|
|
6281
|
-
const VERSION = new Version('14.0.0-next.
|
|
6373
|
+
const VERSION = new Version('14.0.0-next.15');
|
|
6282
6374
|
|
|
6283
6375
|
/**
|
|
6284
6376
|
* @license
|