@angular/router 14.2.0-next.1 → 15.0.0-next.0

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.
Files changed (35) hide show
  1. package/esm2020/src/components/empty_outlet.mjs +3 -3
  2. package/esm2020/src/directives/router_link.mjs +101 -23
  3. package/esm2020/src/directives/router_link_active.mjs +3 -3
  4. package/esm2020/src/directives/router_outlet.mjs +3 -3
  5. package/esm2020/src/errors.mjs +1 -1
  6. package/esm2020/src/index.mjs +3 -2
  7. package/esm2020/src/page_title_strategy.mjs +6 -6
  8. package/esm2020/src/patchable_relative_link_resolution.mjs +12 -0
  9. package/esm2020/src/private_export.mjs +3 -2
  10. package/esm2020/src/provide_router.mjs +420 -0
  11. package/esm2020/src/router.mjs +8 -6
  12. package/esm2020/src/router_config.mjs +1 -1
  13. package/esm2020/src/router_config_loader.mjs +3 -3
  14. package/esm2020/src/router_module.mjs +28 -185
  15. package/esm2020/src/router_outlet_context.mjs +3 -3
  16. package/esm2020/src/router_preloader.mjs +12 -11
  17. package/esm2020/src/router_scroller.mjs +3 -3
  18. package/esm2020/src/url_tree.mjs +13 -11
  19. package/esm2020/src/version.mjs +1 -1
  20. package/esm2020/testing/src/provide_router_for_testing.mjs +51 -0
  21. package/esm2020/testing/src/router_testing_module.mjs +8 -8
  22. package/fesm2015/router.mjs +636 -287
  23. package/fesm2015/router.mjs.map +1 -1
  24. package/fesm2015/testing.mjs +8 -8
  25. package/fesm2015/testing.mjs.map +1 -1
  26. package/fesm2015/upgrade.mjs +1 -1
  27. package/fesm2020/router.mjs +634 -285
  28. package/fesm2020/router.mjs.map +1 -1
  29. package/fesm2020/testing.mjs +8 -8
  30. package/fesm2020/testing.mjs.map +1 -1
  31. package/fesm2020/upgrade.mjs +1 -1
  32. package/index.d.ts +515 -150
  33. package/package.json +4 -4
  34. package/testing/index.d.ts +1 -1
  35. package/upgrade/index.d.ts +1 -1
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Angular v14.2.0-next.1
2
+ * @license Angular v15.0.0-next.0
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, Injectable, ɵRuntimeError, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, inject, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, NgProbeToken, SkipSelf, NgModule, Inject, ApplicationRef, APP_BOOTSTRAP_LISTENER, APP_INITIALIZER, ENVIRONMENT_INITIALIZER, Version } from '@angular/core';
8
+ import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, Directive, Attribute, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, inject, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, Input, HostListener, HostBinding, Optional, ContentChildren, APP_BOOTSTRAP_LISTENER, ApplicationRef, APP_INITIALIZER, ENVIRONMENT_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
9
9
  import { from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
10
10
  import * as i3 from '@angular/common';
11
- import { Location, ViewportScroller, LocationStrategy, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
11
+ import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
12
12
  import { map, switchMap, take, startWith, filter, mergeMap, first, concatMap, tap, catchError, scan, 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
 
@@ -202,10 +202,7 @@ function wrapIntoObservable(value) {
202
202
  * Use of this source code is governed by an MIT-style license that can be
203
203
  * found in the LICENSE file at https://angular.io/license
204
204
  */
205
- const NG_DEV_MODE$8 = typeof ngDevMode === 'undefined' || ngDevMode;
206
- function createEmptyUrlTree() {
207
- return new UrlTree(new UrlSegmentGroup([], {}), {}, null);
208
- }
205
+ const NG_DEV_MODE$9 = typeof ngDevMode === 'undefined' || ngDevMode;
209
206
  const pathCompareMap = {
210
207
  'exact': equalSegmentGroups,
211
208
  'subset': containsSegmentGroup,
@@ -320,17 +317,22 @@ function matrixParamsMatch(containerPaths, containeePaths, options) {
320
317
  * @publicApi
321
318
  */
322
319
  class UrlTree {
323
- /** @internal */
324
320
  constructor(
325
321
  /** The root segment group of the URL tree */
326
- root,
322
+ root = new UrlSegmentGroup([], {}),
327
323
  /** The query params of the URL */
328
- queryParams,
324
+ queryParams = {},
329
325
  /** The fragment of the URL */
330
- fragment) {
326
+ fragment = null) {
331
327
  this.root = root;
332
328
  this.queryParams = queryParams;
333
329
  this.fragment = fragment;
330
+ if (NG_DEV_MODE$9) {
331
+ if (root.segments.length > 0) {
332
+ throw new ɵRuntimeError(4015 /* RuntimeErrorCode.INVALID_ROOT_URL_SEGMENT */, 'The root `UrlSegmentGroup` should not contain `segments`. ' +
333
+ 'Instead, these segments belong in the `children` so they can be associated with a named outlet.');
334
+ }
335
+ }
334
336
  }
335
337
  get queryParamMap() {
336
338
  if (!this._queryParamMap) {
@@ -459,9 +461,9 @@ function mapChildrenIntoArray(segment, fn) {
459
461
  */
460
462
  class UrlSerializer {
461
463
  }
462
- UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
463
- UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
464
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: UrlSerializer, decorators: [{
464
+ UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
465
+ UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: UrlSerializer, decorators: [{
465
467
  type: Injectable,
466
468
  args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
467
469
  }] });
@@ -673,7 +675,7 @@ class UrlParser {
673
675
  parseSegment() {
674
676
  const path = matchSegments(this.remaining);
675
677
  if (path === '' && this.peekStartsWith(';')) {
676
- throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$8 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
678
+ throw new ɵRuntimeError(4009 /* RuntimeErrorCode.EMPTY_PATH_WITH_PARAMS */, NG_DEV_MODE$9 && `Empty path url segment cannot have parameters: '${this.remaining}'.`);
677
679
  }
678
680
  this.capture(path);
679
681
  return new UrlSegment(decode(path), this.parseMatrixParams());
@@ -742,7 +744,7 @@ class UrlParser {
742
744
  // if is is not one of these characters, then the segment was unescaped
743
745
  // or the group was not closed
744
746
  if (next !== '/' && next !== ')' && next !== ';') {
745
- throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$8 && `Cannot parse url '${this.url}'`);
747
+ throw new ɵRuntimeError(4010 /* RuntimeErrorCode.UNPARSABLE_URL */, NG_DEV_MODE$9 && `Cannot parse url '${this.url}'`);
746
748
  }
747
749
  let outletName = undefined;
748
750
  if (path.indexOf(':') > -1) {
@@ -773,7 +775,7 @@ class UrlParser {
773
775
  }
774
776
  capture(str) {
775
777
  if (!this.consumeOptional(str)) {
776
- throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$8 && `Expected "${str}".`);
778
+ throw new ɵRuntimeError(4011 /* RuntimeErrorCode.UNEXPECTED_VALUE_IN_URL */, NG_DEV_MODE$9 && `Expected "${str}".`);
777
779
  }
778
780
  }
779
781
  }
@@ -826,7 +828,7 @@ function isUrlTree(v) {
826
828
  * Use of this source code is governed by an MIT-style license that can be
827
829
  * found in the LICENSE file at https://angular.io/license
828
830
  */
829
- const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
831
+ const NG_DEV_MODE$8 = typeof ngDevMode === 'undefined' || ngDevMode;
830
832
  /**
831
833
  * Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`.
832
834
  *
@@ -1004,11 +1006,11 @@ class Navigation {
1004
1006
  this.numberOfDoubleDots = numberOfDoubleDots;
1005
1007
  this.commands = commands;
1006
1008
  if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) {
1007
- throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$7 && 'Root segment cannot have matrix parameters');
1009
+ throw new ɵRuntimeError(4003 /* RuntimeErrorCode.ROOT_SEGMENT_MATRIX_PARAMS */, NG_DEV_MODE$8 && 'Root segment cannot have matrix parameters');
1008
1010
  }
1009
1011
  const cmdWithOutlet = commands.find(isCommandWithOutlets);
1010
1012
  if (cmdWithOutlet && cmdWithOutlet !== last(commands)) {
1011
- throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$7 && '{outlets:{}} has to be the last command');
1013
+ throw new ɵRuntimeError(4004 /* RuntimeErrorCode.MISPLACED_OUTLETS_COMMAND */, NG_DEV_MODE$8 && '{outlets:{}} has to be the last command');
1012
1014
  }
1013
1015
  }
1014
1016
  toRoot() {
@@ -1107,7 +1109,7 @@ function createPositionApplyingDoubleDots(group, index, numberOfDoubleDots) {
1107
1109
  dd -= ci;
1108
1110
  g = g.parent;
1109
1111
  if (!g) {
1110
- throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$7 && 'Invalid number of \'../\'');
1112
+ throw new ɵRuntimeError(4005 /* RuntimeErrorCode.INVALID_DOUBLE_DOTS */, NG_DEV_MODE$8 && 'Invalid number of \'../\'');
1111
1113
  }
1112
1114
  ci = g.segments.length;
1113
1115
  }
@@ -2388,9 +2390,9 @@ class ChildrenOutletContexts {
2388
2390
  return this.contexts.get(childName) || null;
2389
2391
  }
2390
2392
  }
2391
- ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2392
- ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
2393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
2393
+ ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2394
+ ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
2395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
2394
2396
  type: Injectable,
2395
2397
  args: [{ providedIn: 'root' }]
2396
2398
  }] });
@@ -2402,7 +2404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1",
2402
2404
  * Use of this source code is governed by an MIT-style license that can be
2403
2405
  * found in the LICENSE file at https://angular.io/license
2404
2406
  */
2405
- const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
2407
+ const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
2406
2408
  /**
2407
2409
  * @description
2408
2410
  *
@@ -2512,12 +2514,12 @@ class RouterOutlet {
2512
2514
  */
2513
2515
  get component() {
2514
2516
  if (!this.activated)
2515
- throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
2517
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$7 && 'Outlet is not activated');
2516
2518
  return this.activated.instance;
2517
2519
  }
2518
2520
  get activatedRoute() {
2519
2521
  if (!this.activated)
2520
- throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
2522
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$7 && 'Outlet is not activated');
2521
2523
  return this._activatedRoute;
2522
2524
  }
2523
2525
  get activatedRouteData() {
@@ -2531,7 +2533,7 @@ class RouterOutlet {
2531
2533
  */
2532
2534
  detach() {
2533
2535
  if (!this.activated)
2534
- throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$6 && 'Outlet is not activated');
2536
+ throw new ɵRuntimeError(4012 /* RuntimeErrorCode.OUTLET_NOT_ACTIVATED */, NG_DEV_MODE$7 && 'Outlet is not activated');
2535
2537
  this.location.detach();
2536
2538
  const cmp = this.activated;
2537
2539
  this.activated = null;
@@ -2559,7 +2561,7 @@ class RouterOutlet {
2559
2561
  }
2560
2562
  activateWith(activatedRoute, resolverOrInjector) {
2561
2563
  if (this.isActivated) {
2562
- throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$6 && 'Cannot activate an already activated outlet');
2564
+ throw new ɵRuntimeError(4013 /* RuntimeErrorCode.OUTLET_ALREADY_ACTIVATED */, NG_DEV_MODE$7 && 'Cannot activate an already activated outlet');
2563
2565
  }
2564
2566
  this._activatedRoute = activatedRoute;
2565
2567
  const location = this.location;
@@ -2581,9 +2583,9 @@ class RouterOutlet {
2581
2583
  this.activateEvents.emit(this.activated.instance);
2582
2584
  }
2583
2585
  }
2584
- RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
2585
- RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0-next.1", type: RouterOutlet, isStandalone: true, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterOutlet, decorators: [{
2586
+ RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterOutlet, deps: [{ token: ChildrenOutletContexts }, { token: i0.ViewContainerRef }, { token: 'name', attribute: true }, { token: i0.ChangeDetectorRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
2587
+ RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.0", type: RouterOutlet, isStandalone: true, selector: "router-outlet", outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], ngImport: i0 });
2588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterOutlet, decorators: [{
2587
2589
  type: Directive,
2588
2590
  args: [{
2589
2591
  selector: 'router-outlet',
@@ -2646,9 +2648,9 @@ function isComponentFactoryResolver(item) {
2646
2648
  */
2647
2649
  class ɵEmptyOutletComponent {
2648
2650
  }
2649
- ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2650
- ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0-next.1", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
2651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2651
+ ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2652
+ ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-next.0", type: ɵEmptyOutletComponent, isStandalone: true, 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"] }] });
2653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2652
2654
  type: Component,
2653
2655
  args: [{
2654
2656
  template: `<router-outlet></router-outlet>`,
@@ -3574,7 +3576,7 @@ function noLeftoversInUrl(segmentGroup, segments, outlet) {
3574
3576
  * Use of this source code is governed by an MIT-style license that can be
3575
3577
  * found in the LICENSE file at https://angular.io/license
3576
3578
  */
3577
- const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || ngDevMode;
3579
+ const NG_DEV_MODE$6 = typeof ngDevMode === 'undefined' || ngDevMode;
3578
3580
  class NoMatch$1 {
3579
3581
  constructor(segmentGroup) {
3580
3582
  this.segmentGroup = segmentGroup || null;
@@ -3592,11 +3594,11 @@ function absoluteRedirect(newTree) {
3592
3594
  return throwError(new AbsoluteRedirect(newTree));
3593
3595
  }
3594
3596
  function namedOutletsRedirect(redirectTo) {
3595
- return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$5 &&
3597
+ return throwError(new ɵRuntimeError(4000 /* RuntimeErrorCode.NAMED_OUTLET_REDIRECT */, NG_DEV_MODE$6 &&
3596
3598
  `Only absolute redirects can have named outlets. redirectTo: '${redirectTo}'`));
3597
3599
  }
3598
3600
  function canLoadFails(route) {
3599
- return throwError(navigationCancelingError(NG_DEV_MODE$5 &&
3601
+ return throwError(navigationCancelingError(NG_DEV_MODE$6 &&
3600
3602
  `Cannot load children because the guard of the route "path: '${route.path}'" returned false`, 3 /* NavigationCancellationCode.GuardRejected */));
3601
3603
  }
3602
3604
  /**
@@ -3656,7 +3658,7 @@ class ApplyRedirects {
3656
3658
  }));
3657
3659
  }
3658
3660
  noMatchError(e) {
3659
- return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$5 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
3661
+ return new ɵRuntimeError(4002 /* RuntimeErrorCode.NO_MATCH */, NG_DEV_MODE$6 && `Cannot match any routes. URL Segment: '${e.segmentGroup}'`);
3660
3662
  }
3661
3663
  createUrlTree(rootCandidate, queryParams, fragment) {
3662
3664
  const root = createRoot(rootCandidate);
@@ -3873,7 +3875,7 @@ class ApplyRedirects {
3873
3875
  findPosParam(redirectTo, redirectToUrlSegment, posParams) {
3874
3876
  const pos = posParams[redirectToUrlSegment.path.substring(1)];
3875
3877
  if (!pos)
3876
- throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$5 &&
3878
+ throw new ɵRuntimeError(4001 /* RuntimeErrorCode.MISSING_REDIRECT */, NG_DEV_MODE$6 &&
3877
3879
  `Cannot redirect to '${redirectTo}'. Cannot find '${redirectToUrlSegment.path}'.`);
3878
3880
  return pos;
3879
3881
  }
@@ -3909,7 +3911,7 @@ function applyRedirects(environmentInjector, configLoader, urlSerializer, config
3909
3911
  * Use of this source code is governed by an MIT-style license that can be
3910
3912
  * found in the LICENSE file at https://angular.io/license
3911
3913
  */
3912
- const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || !!ngDevMode;
3914
+ const NG_DEV_MODE$5 = typeof ngDevMode === 'undefined' || !!ngDevMode;
3913
3915
  class NoMatch {
3914
3916
  }
3915
3917
  function newObservableError(e) {
@@ -3998,7 +4000,7 @@ class Recognizer {
3998
4000
  // multiple activated results for the same outlet. We should merge the children of
3999
4001
  // these results so the final return value is only one `TreeNode` per outlet.
4000
4002
  const mergedChildren = mergeEmptyPathMatches(children);
4001
- if (NG_DEV_MODE$4) {
4003
+ if (NG_DEV_MODE$5) {
4002
4004
  // This should really never happen - we are only taking the first match for each
4003
4005
  // outlet and merge the empty path matches.
4004
4006
  checkOutletNameUniqueness(mergedChildren);
@@ -4033,7 +4035,7 @@ class Recognizer {
4033
4035
  // NG_DEV_MODE is used to prevent the getCorrectedPathIndexShift function from affecting
4034
4036
  // production bundle size. This value is intended only to surface a warning to users
4035
4037
  // depending on `relativeLinkResolution: 'legacy'` in dev mode.
4036
- (NG_DEV_MODE$4 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
4038
+ (NG_DEV_MODE$5 ? getCorrectedPathIndexShift(rawSegment) + segments.length :
4037
4039
  pathIndexShift));
4038
4040
  matchResult = of({
4039
4041
  snapshot,
@@ -4050,7 +4052,7 @@ class Recognizer {
4050
4052
  return null;
4051
4053
  }
4052
4054
  const pathIndexShift = getPathIndexShift(rawSegment) + consumedSegments.length;
4053
- 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$4 ?
4055
+ 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$5 ?
4054
4056
  getCorrectedPathIndexShift(rawSegment) + consumedSegments.length :
4055
4057
  pathIndexShift));
4056
4058
  return { snapshot, consumedSegments, remainingSegments };
@@ -4164,7 +4166,7 @@ function checkOutletNameUniqueness(nodes) {
4164
4166
  if (routeWithSameOutletName) {
4165
4167
  const p = routeWithSameOutletName.url.map(s => s.toString()).join('/');
4166
4168
  const c = n.value.url.map(s => s.toString()).join('/');
4167
- throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$4 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
4169
+ throw new ɵRuntimeError(4006 /* RuntimeErrorCode.TWO_SEGMENTS_WITH_SAME_OUTLET */, NG_DEV_MODE$5 && `Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
4168
4170
  }
4169
4171
  names[n.value.outlet] = n.value;
4170
4172
  });
@@ -4350,9 +4352,9 @@ class TitleStrategy {
4350
4352
  return snapshot.data[RouteTitleKey];
4351
4353
  }
4352
4354
  }
4353
- TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4354
- TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
4355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: TitleStrategy, decorators: [{
4355
+ TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4356
+ TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
4357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: TitleStrategy, decorators: [{
4356
4358
  type: Injectable,
4357
4359
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
4358
4360
  }] });
@@ -4376,13 +4378,25 @@ class DefaultTitleStrategy extends TitleStrategy {
4376
4378
  }
4377
4379
  }
4378
4380
  }
4379
- DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
4380
- DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
4381
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4381
+ DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
4382
+ DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
4383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4382
4384
  type: Injectable,
4383
4385
  args: [{ providedIn: 'root' }]
4384
4386
  }], ctorParameters: function () { return [{ type: i1.Title }]; } });
4385
4387
 
4388
+ /**
4389
+ * @license
4390
+ * Copyright Google LLC All Rights Reserved.
4391
+ *
4392
+ * Use of this source code is governed by an MIT-style license that can be
4393
+ * found in the LICENSE file at https://angular.io/license
4394
+ */
4395
+ /**
4396
+ * Exists to aid internal migration off of the deprecated relativeLinkResolution option.
4397
+ */
4398
+ function assignRelativeLinkResolution(router) { }
4399
+
4386
4400
  /**
4387
4401
  * @license
4388
4402
  * Copyright Google LLC All Rights Reserved.
@@ -4455,13 +4469,13 @@ class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
4455
4469
  * Use of this source code is governed by an MIT-style license that can be
4456
4470
  * found in the LICENSE file at https://angular.io/license
4457
4471
  */
4458
- const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4472
+ const NG_DEV_MODE$4 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4459
4473
  /**
4460
4474
  * A [DI token](guide/glossary/#di-token) for the router service.
4461
4475
  *
4462
4476
  * @publicApi
4463
4477
  */
4464
- const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$3 ? 'router config' : '', {
4478
+ const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$4 ? 'router config' : '', {
4465
4479
  providedIn: 'root',
4466
4480
  factory: () => ({}),
4467
4481
  });
@@ -4473,7 +4487,7 @@ const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$3 ? 'router config'
4473
4487
  * Use of this source code is governed by an MIT-style license that can be
4474
4488
  * found in the LICENSE file at https://angular.io/license
4475
4489
  */
4476
- const NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4490
+ const NG_DEV_MODE$3 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4477
4491
  /**
4478
4492
  * The [DI token](guide/glossary/#di-token) for a router configuration.
4479
4493
  *
@@ -4508,7 +4522,7 @@ class RouterConfigLoader {
4508
4522
  if (this.onLoadEndListener) {
4509
4523
  this.onLoadEndListener(route);
4510
4524
  }
4511
- NG_DEV_MODE$2 && assertStandalone((_a = route.path) !== null && _a !== void 0 ? _a : '', component);
4525
+ NG_DEV_MODE$3 && assertStandalone((_a = route.path) !== null && _a !== void 0 ? _a : '', component);
4512
4526
  route._loadedComponent = component;
4513
4527
  }), finalize(() => {
4514
4528
  this.componentLoaders.delete(route);
@@ -4551,7 +4565,7 @@ class RouterConfigLoader {
4551
4565
  rawRoutes = flatten(injector.get(ROUTES, [], InjectFlags.Self | InjectFlags.Optional));
4552
4566
  }
4553
4567
  const routes = rawRoutes.map(standardizeConfig);
4554
- NG_DEV_MODE$2 && validateConfig(routes, route.path, requireStandaloneComponents);
4568
+ NG_DEV_MODE$3 && validateConfig(routes, route.path, requireStandaloneComponents);
4555
4569
  return { routes, injector };
4556
4570
  }), finalize(() => {
4557
4571
  this.childrenLoaders.delete(route);
@@ -4573,9 +4587,9 @@ class RouterConfigLoader {
4573
4587
  }));
4574
4588
  }
4575
4589
  }
4576
- RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
4577
- RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
4578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterConfigLoader, decorators: [{
4590
+ RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
4591
+ RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
4592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterConfigLoader, decorators: [{
4579
4593
  type: Injectable,
4580
4594
  args: [{ providedIn: 'root' }]
4581
4595
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
@@ -4618,7 +4632,7 @@ class DefaultUrlHandlingStrategy {
4618
4632
  * Use of this source code is governed by an MIT-style license that can be
4619
4633
  * found in the LICENSE file at https://angular.io/license
4620
4634
  */
4621
- const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4635
+ const NG_DEV_MODE$2 = typeof ngDevMode === 'undefined' || !!ngDevMode;
4622
4636
  function defaultErrorHandler(error) {
4623
4637
  throw error;
4624
4638
  }
@@ -4690,6 +4704,7 @@ function setupRouter() {
4690
4704
  }
4691
4705
  router.titleStrategy = titleStrategy !== null && titleStrategy !== void 0 ? titleStrategy : defaultTitleStrategy;
4692
4706
  assignExtraOptionsToRouter(opts, router);
4707
+ assignRelativeLinkResolution(router);
4693
4708
  return router;
4694
4709
  }
4695
4710
  /**
@@ -4838,7 +4853,7 @@ class Router {
4838
4853
  const ngZone = injector.get(NgZone);
4839
4854
  this.isNgZoneEnabled = ngZone instanceof NgZone && NgZone.isInAngularZone();
4840
4855
  this.resetConfig(config);
4841
- this.currentUrlTree = createEmptyUrlTree();
4856
+ this.currentUrlTree = new UrlTree();
4842
4857
  this.rawUrlTree = this.currentUrlTree;
4843
4858
  this.browserUrlTree = this.currentUrlTree;
4844
4859
  this.routerState = createEmptyState(this.currentUrlTree, this.rootComponentType);
@@ -5012,7 +5027,7 @@ class Router {
5012
5027
  complete: () => {
5013
5028
  if (!dataResolved) {
5014
5029
  this.restoreHistory(t);
5015
- this.cancelNavigationTransition(t, NG_DEV_MODE$1 ?
5030
+ this.cancelNavigationTransition(t, NG_DEV_MODE$2 ?
5016
5031
  `At least one route resolver didn't emit any value.` :
5017
5032
  '', 2 /* NavigationCancellationCode.NoDataFromResolver */);
5018
5033
  }
@@ -5081,7 +5096,7 @@ class Router {
5081
5096
  * catch-all to make sure the NavigationCancel event is fired when a
5082
5097
  * navigation gets cancelled but not caught by other means. */
5083
5098
  if (!completed && !errored) {
5084
- const cancelationReason = NG_DEV_MODE$1 ?
5099
+ const cancelationReason = NG_DEV_MODE$2 ?
5085
5100
  `Navigation ID ${overallTransitionState
5086
5101
  .id} is not equal to the current navigation id ${this.navigationId}` :
5087
5102
  '';
@@ -5241,7 +5256,7 @@ class Router {
5241
5256
  * ```
5242
5257
  */
5243
5258
  resetConfig(config) {
5244
- NG_DEV_MODE$1 && validateConfig(config);
5259
+ NG_DEV_MODE$2 && validateConfig(config);
5245
5260
  this.config = config.map(standardizeConfig);
5246
5261
  this.navigated = false;
5247
5262
  this.lastSuccessfulId = -1;
@@ -5599,9 +5614,9 @@ class Router {
5599
5614
  return { navigationId };
5600
5615
  }
5601
5616
  }
5602
- Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5603
- Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
5604
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: Router, decorators: [{
5617
+ Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
5618
+ Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
5619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: Router, decorators: [{
5605
5620
  type: Injectable,
5606
5621
  args: [{
5607
5622
  providedIn: 'root',
@@ -5612,7 +5627,7 @@ function validateCommands(commands) {
5612
5627
  for (let i = 0; i < commands.length; i++) {
5613
5628
  const cmd = commands[i];
5614
5629
  if (cmd == null) {
5615
- throw new ɵRuntimeError(4008 /* RuntimeErrorCode.NULLISH_COMMAND */, NG_DEV_MODE$1 && `The requested path contains ${cmd} segment at index ${i}`);
5630
+ throw new ɵRuntimeError(4008 /* RuntimeErrorCode.NULLISH_COMMAND */, NG_DEV_MODE$2 && `The requested path contains ${cmd} segment at index ${i}`);
5616
5631
  }
5617
5632
  }
5618
5633
  }
@@ -5724,11 +5739,50 @@ class RouterLink {
5724
5739
  this.tabIndexAttribute = tabIndexAttribute;
5725
5740
  this.renderer = renderer;
5726
5741
  this.el = el;
5742
+ this._preserveFragment = false;
5743
+ this._skipLocationChange = false;
5744
+ this._replaceUrl = false;
5727
5745
  this.commands = null;
5728
5746
  /** @internal */
5729
5747
  this.onChanges = new Subject();
5730
5748
  this.setTabIndexIfNotOnNativeEl('0');
5731
5749
  }
5750
+ /**
5751
+ * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
5752
+ * `UrlCreationOptions`.
5753
+ * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}
5754
+ * @see {@link Router#createUrlTree Router#createUrlTree}
5755
+ */
5756
+ set preserveFragment(preserveFragment) {
5757
+ this._preserveFragment = ɵcoerceToBoolean(preserveFragment);
5758
+ }
5759
+ get preserveFragment() {
5760
+ return this._preserveFragment;
5761
+ }
5762
+ /**
5763
+ * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
5764
+ * `NavigationBehaviorOptions`.
5765
+ * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}
5766
+ * @see {@link Router#navigateByUrl Router#navigateByUrl}
5767
+ */
5768
+ set skipLocationChange(skipLocationChange) {
5769
+ this._skipLocationChange = ɵcoerceToBoolean(skipLocationChange);
5770
+ }
5771
+ get skipLocationChange() {
5772
+ return this._skipLocationChange;
5773
+ }
5774
+ /**
5775
+ * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
5776
+ * `NavigationBehaviorOptions`.
5777
+ * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}
5778
+ * @see {@link Router#navigateByUrl Router#navigateByUrl}
5779
+ */
5780
+ set replaceUrl(replaceUrl) {
5781
+ this._replaceUrl = ɵcoerceToBoolean(replaceUrl);
5782
+ }
5783
+ get replaceUrl() {
5784
+ return this._replaceUrl;
5785
+ }
5732
5786
  /**
5733
5787
  * Modifies the tab index if there was not a tabindex attribute on the element during
5734
5788
  * instantiation.
@@ -5775,8 +5829,8 @@ class RouterLink {
5775
5829
  return true;
5776
5830
  }
5777
5831
  const extras = {
5778
- skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
5779
- replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
5832
+ skipLocationChange: this.skipLocationChange,
5833
+ replaceUrl: this.replaceUrl,
5780
5834
  state: this.state,
5781
5835
  };
5782
5836
  this.router.navigateByUrl(this.urlTree, extras);
@@ -5793,13 +5847,13 @@ class RouterLink {
5793
5847
  queryParams: this.queryParams,
5794
5848
  fragment: this.fragment,
5795
5849
  queryParamsHandling: this.queryParamsHandling,
5796
- preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
5850
+ preserveFragment: this.preserveFragment,
5797
5851
  });
5798
5852
  }
5799
5853
  }
5800
- RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5801
- RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0-next.1", type: RouterLink, isStandalone: true, 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 });
5802
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterLink, decorators: [{
5854
+ RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
5855
+ RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.0", type: RouterLink, isStandalone: true, selector: ":not(a):not(area)[routerLink]", inputs: { queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick()" } }, usesOnChanges: true, ngImport: i0 });
5856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterLink, decorators: [{
5803
5857
  type: Directive,
5804
5858
  args: [{
5805
5859
  selector: ':not(a):not(area)[routerLink]',
@@ -5816,16 +5870,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1",
5816
5870
  type: Input
5817
5871
  }], queryParamsHandling: [{
5818
5872
  type: Input
5873
+ }], state: [{
5874
+ type: Input
5875
+ }], relativeTo: [{
5876
+ type: Input
5819
5877
  }], preserveFragment: [{
5820
5878
  type: Input
5821
5879
  }], skipLocationChange: [{
5822
5880
  type: Input
5823
5881
  }], replaceUrl: [{
5824
5882
  type: Input
5825
- }], state: [{
5826
- type: Input
5827
- }], relativeTo: [{
5828
- type: Input
5829
5883
  }], routerLink: [{
5830
5884
  type: Input
5831
5885
  }], onClick: [{
@@ -5848,6 +5902,9 @@ class RouterLinkWithHref {
5848
5902
  this.router = router;
5849
5903
  this.route = route;
5850
5904
  this.locationStrategy = locationStrategy;
5905
+ this._preserveFragment = false;
5906
+ this._skipLocationChange = false;
5907
+ this._replaceUrl = false;
5851
5908
  this.commands = null;
5852
5909
  // the url displayed on the anchor element.
5853
5910
  // @HostBinding('attr.href') is used rather than @HostBinding() because it removes the
@@ -5861,6 +5918,42 @@ class RouterLinkWithHref {
5861
5918
  }
5862
5919
  });
5863
5920
  }
5921
+ /**
5922
+ * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
5923
+ * `UrlCreationOptions`.
5924
+ * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}
5925
+ * @see {@link Router#createUrlTree Router#createUrlTree}
5926
+ */
5927
+ set preserveFragment(preserveFragment) {
5928
+ this._preserveFragment = ɵcoerceToBoolean(preserveFragment);
5929
+ }
5930
+ get preserveFragment() {
5931
+ return this._preserveFragment;
5932
+ }
5933
+ /**
5934
+ * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
5935
+ * `NavigationBehaviorOptions`.
5936
+ * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}
5937
+ * @see {@link Router#navigateByUrl Router#navigateByUrl}
5938
+ */
5939
+ set skipLocationChange(skipLocationChange) {
5940
+ this._skipLocationChange = ɵcoerceToBoolean(skipLocationChange);
5941
+ }
5942
+ get skipLocationChange() {
5943
+ return this._skipLocationChange;
5944
+ }
5945
+ /**
5946
+ * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
5947
+ * `NavigationBehaviorOptions`.
5948
+ * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}
5949
+ * @see {@link Router#navigateByUrl Router#navigateByUrl}
5950
+ */
5951
+ set replaceUrl(replaceUrl) {
5952
+ this._replaceUrl = ɵcoerceToBoolean(replaceUrl);
5953
+ }
5954
+ get replaceUrl() {
5955
+ return this._replaceUrl;
5956
+ }
5864
5957
  /**
5865
5958
  * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
5866
5959
  * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
@@ -5894,8 +5987,8 @@ class RouterLinkWithHref {
5894
5987
  return true;
5895
5988
  }
5896
5989
  const extras = {
5897
- skipLocationChange: ɵcoerceToBoolean(this.skipLocationChange),
5898
- replaceUrl: ɵcoerceToBoolean(this.replaceUrl),
5990
+ skipLocationChange: this.skipLocationChange,
5991
+ replaceUrl: this.replaceUrl,
5899
5992
  state: this.state
5900
5993
  };
5901
5994
  this.router.navigateByUrl(this.urlTree, extras);
@@ -5917,13 +6010,13 @@ class RouterLinkWithHref {
5917
6010
  queryParams: this.queryParams,
5918
6011
  fragment: this.fragment,
5919
6012
  queryParamsHandling: this.queryParamsHandling,
5920
- preserveFragment: ɵcoerceToBoolean(this.preserveFragment),
6013
+ preserveFragment: this.preserveFragment,
5921
6014
  });
5922
6015
  }
5923
6016
  }
5924
- RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
5925
- RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0-next.1", type: RouterLinkWithHref, isStandalone: true, 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 });
5926
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterLinkWithHref, decorators: [{
6017
+ RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
6018
+ RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.0", type: RouterLinkWithHref, isStandalone: true, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
6019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterLinkWithHref, decorators: [{
5927
6020
  type: Directive,
5928
6021
  args: [{ selector: 'a[routerLink],area[routerLink]', standalone: true }]
5929
6022
  }], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
@@ -5937,12 +6030,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1",
5937
6030
  type: Input
5938
6031
  }], queryParamsHandling: [{
5939
6032
  type: Input
5940
- }], preserveFragment: [{
5941
- type: Input
5942
- }], skipLocationChange: [{
5943
- type: Input
5944
- }], replaceUrl: [{
5945
- type: Input
5946
6033
  }], state: [{
5947
6034
  type: Input
5948
6035
  }], relativeTo: [{
@@ -5950,6 +6037,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1",
5950
6037
  }], href: [{
5951
6038
  type: HostBinding,
5952
6039
  args: ['attr.href']
6040
+ }], preserveFragment: [{
6041
+ type: Input
6042
+ }], skipLocationChange: [{
6043
+ type: Input
6044
+ }], replaceUrl: [{
6045
+ type: Input
5953
6046
  }], routerLink: [{
5954
6047
  type: Input
5955
6048
  }], onClick: [{
@@ -6150,9 +6243,9 @@ class RouterLinkActive {
6150
6243
  this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
6151
6244
  }
6152
6245
  }
6153
- RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", 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 });
6154
- RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0-next.1", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }, { propertyName: "linksWithHrefs", predicate: RouterLinkWithHref, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
6155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterLinkActive, decorators: [{
6246
+ RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", 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 });
6247
+ RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.0", type: RouterLinkActive, isStandalone: true, 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 });
6248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterLinkActive, decorators: [{
6156
6249
  type: Directive,
6157
6250
  args: [{
6158
6251
  selector: '[routerLinkActive]',
@@ -6219,9 +6312,9 @@ class PreloadAllModules {
6219
6312
  return fn().pipe(catchError(() => of(null)));
6220
6313
  }
6221
6314
  }
6222
- PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6223
- PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
6224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: PreloadAllModules, decorators: [{
6315
+ PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6316
+ PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
6317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: PreloadAllModules, decorators: [{
6225
6318
  type: Injectable,
6226
6319
  args: [{ providedIn: 'root' }]
6227
6320
  }] });
@@ -6239,9 +6332,9 @@ class NoPreloading {
6239
6332
  return of(null);
6240
6333
  }
6241
6334
  }
6242
- NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6243
- NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: NoPreloading, providedIn: 'root' });
6244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: NoPreloading, decorators: [{
6335
+ NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6336
+ NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: NoPreloading, providedIn: 'root' });
6337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: NoPreloading, decorators: [{
6245
6338
  type: Injectable,
6246
6339
  args: [{ providedIn: 'root' }]
6247
6340
  }] });
@@ -6337,10 +6430,11 @@ class RouterPreloader {
6337
6430
  });
6338
6431
  }
6339
6432
  }
6340
- RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
6341
- RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterPreloader });
6342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterPreloader, decorators: [{
6343
- type: Injectable
6433
+ RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
6434
+ RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
6435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterPreloader, decorators: [{
6436
+ type: Injectable,
6437
+ args: [{ providedIn: 'root' }]
6344
6438
  }], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
6345
6439
 
6346
6440
  const ROUTER_SCROLLER = new InjectionToken('');
@@ -6419,12 +6513,423 @@ class RouterScroller {
6419
6513
  }
6420
6514
  }
6421
6515
  }
6422
- RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
6423
- RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterScroller });
6424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterScroller, decorators: [{
6516
+ RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
6517
+ RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterScroller });
6518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterScroller, decorators: [{
6425
6519
  type: Injectable
6426
6520
  }], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
6427
6521
 
6522
+ /**
6523
+ * @license
6524
+ * Copyright Google LLC All Rights Reserved.
6525
+ *
6526
+ * Use of this source code is governed by an MIT-style license that can be
6527
+ * found in the LICENSE file at https://angular.io/license
6528
+ */
6529
+ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode;
6530
+ /**
6531
+ * Sets up providers necessary to enable `Router` functionality for the application.
6532
+ * Allows to configure a set of routes as well as extra features that should be enabled.
6533
+ *
6534
+ * @usageNotes
6535
+ *
6536
+ * Basic example of how you can add a Router to your application:
6537
+ * ```
6538
+ * const appRoutes: Routes = [];
6539
+ * bootstrapApplication(AppComponent, {
6540
+ * providers: [provideRouter(appRoutes)]
6541
+ * });
6542
+ * ```
6543
+ *
6544
+ * You can also enable optional features in the Router by adding functions from the `RouterFeatures`
6545
+ * type:
6546
+ * ```
6547
+ * const appRoutes: Routes = [];
6548
+ * bootstrapApplication(AppComponent,
6549
+ * {
6550
+ * providers: [
6551
+ * provideRouter(appRoutes,
6552
+ * withDebugTracing(),
6553
+ * withRouterConfig({paramsInheritanceStrategy: 'always'}))
6554
+ * ]
6555
+ * }
6556
+ * );
6557
+ * ```
6558
+ *
6559
+ * @see `RouterFeatures`
6560
+ *
6561
+ * @publicApi
6562
+ * @developerPreview
6563
+ * @param routes A set of `Route`s to use for the application routing table.
6564
+ * @param features Optional features to configure additional router behaviors.
6565
+ * @returns A set of providers to setup a Router.
6566
+ */
6567
+ function provideRouter(routes, ...features) {
6568
+ return [
6569
+ provideRoutes(routes), { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
6570
+ { provide: APP_BOOTSTRAP_LISTENER, multi: true, useFactory: getBootstrapListener },
6571
+ features.map(feature => feature.ɵproviders),
6572
+ // TODO: All options used by the `assignExtraOptionsToRouter` factory need to be reviewed for
6573
+ // how we want them to be configured. This API doesn't currently have a way to configure them
6574
+ // and we should decide what the _best_ way to do that is rather than just sticking with the
6575
+ // status quo of how it's done today.
6576
+ ];
6577
+ }
6578
+ function rootRoute(router) {
6579
+ return router.routerState.root;
6580
+ }
6581
+ /**
6582
+ * Helper function to create an object that represents a Router feature.
6583
+ */
6584
+ function routerFeature(kind, providers) {
6585
+ return { ɵkind: kind, ɵproviders: providers };
6586
+ }
6587
+ /**
6588
+ * Registers a [DI provider](guide/glossary#provider) for a set of routes.
6589
+ * @param routes The route configuration to provide.
6590
+ *
6591
+ * @usageNotes
6592
+ *
6593
+ * ```
6594
+ * @NgModule({
6595
+ * providers: [provideRoutes(ROUTES)]
6596
+ * })
6597
+ * class LazyLoadedChildModule {}
6598
+ * ```
6599
+ *
6600
+ * @publicApi
6601
+ */
6602
+ function provideRoutes(routes) {
6603
+ return [
6604
+ { provide: ROUTES, multi: true, useValue: routes },
6605
+ ];
6606
+ }
6607
+ /**
6608
+ * Enables customizable scrolling behavior for router navigations.
6609
+ *
6610
+ * @usageNotes
6611
+ *
6612
+ * Basic example of how you can enable scrolling feature:
6613
+ * ```
6614
+ * const appRoutes: Routes = [];
6615
+ * bootstrapApplication(AppComponent,
6616
+ * {
6617
+ * providers: [
6618
+ * provideRouter(appRoutes, withInMemoryScrolling())
6619
+ * ]
6620
+ * }
6621
+ * );
6622
+ * ```
6623
+ *
6624
+ * @see `provideRouter`
6625
+ * @see `ViewportScroller`
6626
+ *
6627
+ * @publicApi
6628
+ * @developerPreview
6629
+ * @param options Set of configuration parameters to customize scrolling behavior, see
6630
+ * `InMemoryScrollingOptions` for additional information.
6631
+ * @returns A set of providers for use with `provideRouter`.
6632
+ */
6633
+ function withInMemoryScrolling(options = {}) {
6634
+ const providers = [{
6635
+ provide: ROUTER_SCROLLER,
6636
+ useFactory: () => {
6637
+ const router = inject(Router);
6638
+ const viewportScroller = inject(ViewportScroller);
6639
+ return new RouterScroller(router, viewportScroller, options);
6640
+ },
6641
+ }];
6642
+ return routerFeature(4 /* RouterFeatureKind.InMemoryScrollingFeature */, providers);
6643
+ }
6644
+ function getBootstrapListener() {
6645
+ const injector = inject(Injector);
6646
+ return (bootstrappedComponentRef) => {
6647
+ var _a, _b;
6648
+ const ref = injector.get(ApplicationRef);
6649
+ if (bootstrappedComponentRef !== ref.components[0]) {
6650
+ return;
6651
+ }
6652
+ const router = injector.get(Router);
6653
+ const bootstrapDone = injector.get(BOOTSTRAP_DONE);
6654
+ if (injector.get(INITIAL_NAVIGATION) === 1 /* InitialNavigation.EnabledNonBlocking */) {
6655
+ router.initialNavigation();
6656
+ }
6657
+ (_a = injector.get(ROUTER_PRELOADER, null, InjectFlags.Optional)) === null || _a === void 0 ? void 0 : _a.setUpPreloading();
6658
+ (_b = injector.get(ROUTER_SCROLLER, null, InjectFlags.Optional)) === null || _b === void 0 ? void 0 : _b.init();
6659
+ router.resetRootComponentType(ref.componentTypes[0]);
6660
+ bootstrapDone.next();
6661
+ bootstrapDone.complete();
6662
+ };
6663
+ }
6664
+ /**
6665
+ * A subject used to indicate that the bootstrapping phase is done. When initial navigation is
6666
+ * `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing
6667
+ * to the activation phase.
6668
+ */
6669
+ const BOOTSTRAP_DONE = new InjectionToken(NG_DEV_MODE$1 ? 'bootstrap done indicator' : '', {
6670
+ factory: () => {
6671
+ return new Subject();
6672
+ }
6673
+ });
6674
+ const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE$1 ? 'initial navigation' : '', { providedIn: 'root', factory: () => 1 /* InitialNavigation.EnabledNonBlocking */ });
6675
+ /**
6676
+ * Configures initial navigation to start before the root component is created.
6677
+ *
6678
+ * The bootstrap is blocked until the initial navigation is complete. This value is required for
6679
+ * [server-side rendering](guide/universal) to work.
6680
+ *
6681
+ * @usageNotes
6682
+ *
6683
+ * Basic example of how you can enable this navigation behavior:
6684
+ * ```
6685
+ * const appRoutes: Routes = [];
6686
+ * bootstrapApplication(AppComponent,
6687
+ * {
6688
+ * providers: [
6689
+ * provideRouter(appRoutes, withEnabledBlockingInitialNavigation())
6690
+ * ]
6691
+ * }
6692
+ * );
6693
+ * ```
6694
+ *
6695
+ * @see `provideRouter`
6696
+ *
6697
+ * @publicApi
6698
+ * @developerPreview
6699
+ * @returns A set of providers for use with `provideRouter`.
6700
+ */
6701
+ function withEnabledBlockingInitialNavigation() {
6702
+ const providers = [
6703
+ { provide: INITIAL_NAVIGATION, useValue: 0 /* InitialNavigation.EnabledBlocking */ },
6704
+ {
6705
+ provide: APP_INITIALIZER,
6706
+ multi: true,
6707
+ deps: [Injector],
6708
+ useFactory: (injector) => {
6709
+ const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
6710
+ let initNavigation = false;
6711
+ /**
6712
+ * Performs the given action once the router finishes its next/current navigation.
6713
+ *
6714
+ * If the navigation is canceled or errors without a redirect, the navigation is considered
6715
+ * complete. If the `NavigationEnd` event emits, the navigation is also considered complete.
6716
+ */
6717
+ function afterNextNavigation(action) {
6718
+ const router = injector.get(Router);
6719
+ router.events
6720
+ .pipe(filter((e) => e instanceof NavigationEnd || e instanceof NavigationCancel ||
6721
+ e instanceof NavigationError), map(e => {
6722
+ if (e instanceof NavigationEnd) {
6723
+ // Navigation assumed to succeed if we get `ActivationStart`
6724
+ return true;
6725
+ }
6726
+ const redirecting = e instanceof NavigationCancel ?
6727
+ (e.code === 0 /* NavigationCancellationCode.Redirect */ ||
6728
+ e.code === 1 /* NavigationCancellationCode.SupersededByNewNavigation */) :
6729
+ false;
6730
+ return redirecting ? null : false;
6731
+ }), filter((result) => result !== null), take(1))
6732
+ .subscribe(() => {
6733
+ action();
6734
+ });
6735
+ }
6736
+ return () => {
6737
+ return locationInitialized.then(() => {
6738
+ return new Promise(resolve => {
6739
+ const router = injector.get(Router);
6740
+ const bootstrapDone = injector.get(BOOTSTRAP_DONE);
6741
+ afterNextNavigation(() => {
6742
+ // Unblock APP_INITIALIZER in case the initial navigation was canceled or errored
6743
+ // without a redirect.
6744
+ resolve(true);
6745
+ initNavigation = true;
6746
+ });
6747
+ router.afterPreactivation = () => {
6748
+ // Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we
6749
+ // assume activation will complete successfully (even though this is not
6750
+ // guaranteed).
6751
+ resolve(true);
6752
+ // only the initial navigation should be delayed until bootstrapping is done.
6753
+ if (!initNavigation) {
6754
+ return bootstrapDone.closed ? of(void 0) : bootstrapDone;
6755
+ // subsequent navigations should not be delayed
6756
+ }
6757
+ else {
6758
+ return of(void 0);
6759
+ }
6760
+ };
6761
+ router.initialNavigation();
6762
+ });
6763
+ });
6764
+ };
6765
+ }
6766
+ },
6767
+ ];
6768
+ return routerFeature(2 /* RouterFeatureKind.EnabledBlockingInitialNavigationFeature */, providers);
6769
+ }
6770
+ /**
6771
+ * Disables initial navigation.
6772
+ *
6773
+ * Use if there is a reason to have more control over when the router starts its initial navigation
6774
+ * due to some complex initialization logic.
6775
+ *
6776
+ * @usageNotes
6777
+ *
6778
+ * Basic example of how you can disable initial navigation:
6779
+ * ```
6780
+ * const appRoutes: Routes = [];
6781
+ * bootstrapApplication(AppComponent,
6782
+ * {
6783
+ * providers: [
6784
+ * provideRouter(appRoutes, withDisabledInitialNavigation())
6785
+ * ]
6786
+ * }
6787
+ * );
6788
+ * ```
6789
+ *
6790
+ * @see `provideRouter`
6791
+ *
6792
+ * @returns A set of providers for use with `provideRouter`.
6793
+ *
6794
+ * @publicApi
6795
+ * @developerPreview
6796
+ */
6797
+ function withDisabledInitialNavigation() {
6798
+ const providers = [
6799
+ {
6800
+ provide: APP_INITIALIZER,
6801
+ multi: true,
6802
+ useFactory: () => {
6803
+ const router = inject(Router);
6804
+ return () => {
6805
+ router.setUpLocationChangeListener();
6806
+ };
6807
+ }
6808
+ },
6809
+ { provide: INITIAL_NAVIGATION, useValue: 2 /* InitialNavigation.Disabled */ }
6810
+ ];
6811
+ return routerFeature(3 /* RouterFeatureKind.DisabledInitialNavigationFeature */, providers);
6812
+ }
6813
+ /**
6814
+ * Enables logging of all internal navigation events to the console.
6815
+ * Extra logging might be useful for debugging purposes to inspect Router event sequence.
6816
+ *
6817
+ * @usageNotes
6818
+ *
6819
+ * Basic example of how you can enable debug tracing:
6820
+ * ```
6821
+ * const appRoutes: Routes = [];
6822
+ * bootstrapApplication(AppComponent,
6823
+ * {
6824
+ * providers: [
6825
+ * provideRouter(appRoutes, withDebugTracing())
6826
+ * ]
6827
+ * }
6828
+ * );
6829
+ * ```
6830
+ *
6831
+ * @see `provideRouter`
6832
+ *
6833
+ * @returns A set of providers for use with `provideRouter`.
6834
+ *
6835
+ * @publicApi
6836
+ * @developerPreview
6837
+ */
6838
+ function withDebugTracing() {
6839
+ let providers = [];
6840
+ if (NG_DEV_MODE$1) {
6841
+ providers = [{
6842
+ provide: ENVIRONMENT_INITIALIZER,
6843
+ multi: true,
6844
+ useFactory: () => {
6845
+ const router = inject(Router);
6846
+ return () => router.events.subscribe((e) => {
6847
+ var _a, _b;
6848
+ // tslint:disable:no-console
6849
+ (_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, `Router Event: ${e.constructor.name}`);
6850
+ console.log(stringifyEvent(e));
6851
+ console.log(e);
6852
+ (_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console);
6853
+ // tslint:enable:no-console
6854
+ });
6855
+ }
6856
+ }];
6857
+ }
6858
+ else {
6859
+ providers = [];
6860
+ }
6861
+ return routerFeature(1 /* RouterFeatureKind.DebugTracingFeature */, providers);
6862
+ }
6863
+ const ROUTER_PRELOADER = new InjectionToken(NG_DEV_MODE$1 ? 'router preloader' : '');
6864
+ /**
6865
+ * Allows to configure a preloading strategy to use. The strategy is configured by providing a
6866
+ * reference to a class that implements a `PreloadingStrategy`.
6867
+ *
6868
+ * @usageNotes
6869
+ *
6870
+ * Basic example of how you can configure preloading:
6871
+ * ```
6872
+ * const appRoutes: Routes = [];
6873
+ * bootstrapApplication(AppComponent,
6874
+ * {
6875
+ * providers: [
6876
+ * provideRouter(appRoutes, withPreloading(PreloadAllModules))
6877
+ * ]
6878
+ * }
6879
+ * );
6880
+ * ```
6881
+ *
6882
+ * @see `provideRouter`
6883
+ *
6884
+ * @param preloadingStrategy A reference to a class that implements a `PreloadingStrategy` that
6885
+ * should be used.
6886
+ * @returns A set of providers for use with `provideRouter`.
6887
+ *
6888
+ * @publicApi
6889
+ * @developerPreview
6890
+ */
6891
+ function withPreloading(preloadingStrategy) {
6892
+ const providers = [
6893
+ { provide: ROUTER_PRELOADER, useExisting: RouterPreloader },
6894
+ { provide: PreloadingStrategy, useExisting: preloadingStrategy },
6895
+ ];
6896
+ return routerFeature(0 /* RouterFeatureKind.PreloadingFeature */, providers);
6897
+ }
6898
+ /**
6899
+ * Allows to provide extra parameters to configure Router.
6900
+ *
6901
+ * @usageNotes
6902
+ *
6903
+ * Basic example of how you can provide extra configuration options:
6904
+ * ```
6905
+ * const appRoutes: Routes = [];
6906
+ * bootstrapApplication(AppComponent,
6907
+ * {
6908
+ * providers: [
6909
+ * provideRouter(appRoutes, withRouterConfig({
6910
+ * onSameUrlNavigation: 'reload'
6911
+ * }))
6912
+ * ]
6913
+ * }
6914
+ * );
6915
+ * ```
6916
+ *
6917
+ * @see `provideRouter`
6918
+ *
6919
+ * @param options A set of parameters to configure Router, see `RouterConfigOptions` for
6920
+ * additional information.
6921
+ * @returns A set of providers for use with `provideRouter`.
6922
+ *
6923
+ * @publicApi
6924
+ * @developerPreview
6925
+ */
6926
+ function withRouterConfig(options) {
6927
+ const providers = [
6928
+ { provide: ROUTER_CONFIGURATION, useValue: options },
6929
+ ];
6930
+ return routerFeature(5 /* RouterFeatureKind.RouterConfigurationFeature */, providers);
6931
+ }
6932
+
6428
6933
  /**
6429
6934
  * @license
6430
6935
  * Copyright Google LLC All Rights Reserved.
@@ -6441,7 +6946,6 @@ const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref, RouterL
6441
6946
  * @docsNotRequired
6442
6947
  */
6443
6948
  const ROUTER_FORROOT_GUARD = new InjectionToken(NG_DEV_MODE ? 'router duplicate forRoot guard' : 'ROUTER_FORROOT_GUARD');
6444
- const ROUTER_PRELOADER = new InjectionToken(NG_DEV_MODE ? 'router preloader' : '');
6445
6949
  // TODO(atscott): All of these except `ActivatedRoute` are `providedIn: 'root'`. They are only kept
6446
6950
  // here to avoid a breaking change whereby the provider order matters based on where the
6447
6951
  // `RouterModule`/`RouterTestingModule` is imported. These can/should be removed as a "breaking"
@@ -6454,9 +6958,6 @@ const ROUTER_PROVIDERS = [
6454
6958
  { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
6455
6959
  RouterConfigLoader,
6456
6960
  ];
6457
- function rootRoute(router) {
6458
- return router.routerState.root;
6459
- }
6460
6961
  function routerNgProbeToken() {
6461
6962
  return new NgProbeToken('Router', Router);
6462
6963
  }
@@ -6506,7 +7007,7 @@ class RouterModule {
6506
7007
  ngModule: RouterModule,
6507
7008
  providers: [
6508
7009
  ROUTER_PROVIDERS,
6509
- NG_DEV_MODE ? ((config === null || config === void 0 ? void 0 : config.enableTracing) ? provideTracing() : []) : [],
7010
+ NG_DEV_MODE ? ((config === null || config === void 0 ? void 0 : config.enableTracing) ? withDebugTracing().ɵproviders : []) : [],
6510
7011
  provideRoutes(routes),
6511
7012
  {
6512
7013
  provide: ROUTER_FORROOT_GUARD,
@@ -6516,7 +7017,7 @@ class RouterModule {
6516
7017
  { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
6517
7018
  (config === null || config === void 0 ? void 0 : config.useHash) ? provideHashLocationStrategy() : providePathLocationStrategy(),
6518
7019
  provideRouterScroller(),
6519
- (config === null || config === void 0 ? void 0 : config.preloadingStrategy) ? providePreloading(config.preloadingStrategy) : [],
7020
+ (config === null || config === void 0 ? void 0 : config.preloadingStrategy) ? withPreloading(config.preloadingStrategy).ɵproviders : [],
6520
7021
  { provide: NgProbeToken, multi: true, useFactory: routerNgProbeToken },
6521
7022
  (config === null || config === void 0 ? void 0 : config.initialNavigation) ? provideInitialNavigation(config) : [],
6522
7023
  provideRouterInitializer(),
@@ -6543,10 +7044,10 @@ class RouterModule {
6543
7044
  return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
6544
7045
  }
6545
7046
  }
6546
- RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
6547
- RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
6548
- RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
6549
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1", ngImport: i0, type: RouterModule, decorators: [{
7047
+ RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
7048
+ RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkWithHref, RouterLinkActive, ɵEmptyOutletComponent] });
7049
+ RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
7050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.0", ngImport: i0, type: RouterModule, decorators: [{
6550
7051
  type: NgModule,
6551
7052
  args: [{
6552
7053
  imports: ROUTER_DIRECTIVES,
@@ -6560,6 +7061,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0-next.1",
6560
7061
  args: [ROUTER_FORROOT_GUARD]
6561
7062
  }] }];
6562
7063
  } });
7064
+ /**
7065
+ * For internal use by `RouterModule` only. Note that this differs from `withInMemoryRouterScroller`
7066
+ * because it reads from the `ExtraOptions` which should not be used in the standalone world.
7067
+ */
6563
7068
  function provideRouterScroller() {
6564
7069
  return {
6565
7070
  provide: ROUTER_SCROLLER,
@@ -6574,59 +7079,33 @@ function provideRouterScroller() {
6574
7079
  },
6575
7080
  };
6576
7081
  }
7082
+ // Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` should
7083
+ // provide hash location directly via `{provide: LocationStrategy, useClass: HashLocationStrategy}`.
6577
7084
  function provideHashLocationStrategy() {
6578
7085
  return { provide: LocationStrategy, useClass: HashLocationStrategy };
6579
7086
  }
7087
+ // Note: For internal use only with `RouterModule`. Standalone setup via `provideRouter` does not
7088
+ // need this at all because `PathLocationStrategy` is the default factory for `LocationStrategy`.
6580
7089
  function providePathLocationStrategy() {
6581
7090
  return { provide: LocationStrategy, useClass: PathLocationStrategy };
6582
7091
  }
6583
7092
  function provideForRootGuard(router) {
6584
7093
  if (NG_DEV_MODE && router) {
6585
- throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.`);
7094
+ throw new ɵRuntimeError(4007 /* RuntimeErrorCode.FOR_ROOT_CALLED_TWICE */, `The Router was provided more than once. This can happen if 'forRoot' is used outside of the root injector.` +
7095
+ ` Lazy loaded modules should use RouterModule.forChild() instead.`);
6586
7096
  }
6587
7097
  return 'guarded';
6588
7098
  }
6589
- /**
6590
- * Registers a [DI provider](guide/glossary#provider) for a set of routes.
6591
- * @param routes The route configuration to provide.
6592
- *
6593
- * @usageNotes
6594
- *
6595
- * ```
6596
- * @NgModule({
6597
- * imports: [RouterModule.forChild(ROUTES)],
6598
- * providers: [provideRoutes(EXTRA_ROUTES)]
6599
- * })
6600
- * class MyNgModule {}
6601
- * ```
6602
- *
6603
- * @publicApi
6604
- */
6605
- function provideRoutes(routes) {
7099
+ // Note: For internal use only with `RouterModule`. Standalone router setup with `provideRouter`
7100
+ // users call `withXInitialNavigation` directly.
7101
+ function provideInitialNavigation(config) {
6606
7102
  return [
6607
- { provide: ROUTES, multi: true, useValue: routes },
7103
+ config.initialNavigation === 'disabled' ? withDisabledInitialNavigation().ɵproviders : [],
7104
+ config.initialNavigation === 'enabledBlocking' ?
7105
+ withEnabledBlockingInitialNavigation().ɵproviders :
7106
+ [],
6608
7107
  ];
6609
7108
  }
6610
- function getBootstrapListener() {
6611
- const injector = inject(Injector);
6612
- return (bootstrappedComponentRef) => {
6613
- var _a, _b;
6614
- const ref = injector.get(ApplicationRef);
6615
- if (bootstrappedComponentRef !== ref.components[0]) {
6616
- return;
6617
- }
6618
- const router = injector.get(Router);
6619
- const bootstrapDone = injector.get(BOOTSTRAP_DONE);
6620
- if (injector.get(INITIAL_NAVIGATION) === 1 /* InitialNavigation.EnabledNonBlocking */) {
6621
- router.initialNavigation();
6622
- }
6623
- (_a = injector.get(ROUTER_PRELOADER, null, InjectFlags.Optional)) === null || _a === void 0 ? void 0 : _a.setUpPreloading();
6624
- (_b = injector.get(ROUTER_SCROLLER, null, InjectFlags.Optional)) === null || _b === void 0 ? void 0 : _b.init();
6625
- router.resetRootComponentType(ref.componentTypes[0]);
6626
- bootstrapDone.next();
6627
- bootstrapDone.complete();
6628
- };
6629
- }
6630
7109
  // TODO(atscott): This should not be in the public API
6631
7110
  /**
6632
7111
  * A [DI token](guide/glossary/#di-token) for the router initializer that
@@ -6635,12 +7114,6 @@ function getBootstrapListener() {
6635
7114
  * @publicApi
6636
7115
  */
6637
7116
  const ROUTER_INITIALIZER = new InjectionToken(NG_DEV_MODE ? 'Router Initializer' : '');
6638
- function provideInitialNavigation(config) {
6639
- return [
6640
- config.initialNavigation === 'disabled' ? provideDisabledInitialNavigation() : [],
6641
- config.initialNavigation === 'enabledBlocking' ? provideEnabledBlockingInitialNavigation() : [],
6642
- ];
6643
- }
6644
7117
  function provideRouterInitializer() {
6645
7118
  return [
6646
7119
  // ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just
@@ -6649,130 +7122,6 @@ function provideRouterInitializer() {
6649
7122
  { provide: APP_BOOTSTRAP_LISTENER, multi: true, useExisting: ROUTER_INITIALIZER },
6650
7123
  ];
6651
7124
  }
6652
- /**
6653
- * A subject used to indicate that the bootstrapping phase is done. When initial navigation is
6654
- * `enabledBlocking`, the first navigation waits until bootstrapping is finished before continuing
6655
- * to the activation phase.
6656
- */
6657
- const BOOTSTRAP_DONE = new InjectionToken(NG_DEV_MODE ? 'bootstrap done indicator' : '', {
6658
- factory: () => {
6659
- return new Subject();
6660
- }
6661
- });
6662
- function provideEnabledBlockingInitialNavigation() {
6663
- return [
6664
- { provide: INITIAL_NAVIGATION, useValue: 0 /* InitialNavigation.EnabledBlocking */ },
6665
- {
6666
- provide: APP_INITIALIZER,
6667
- multi: true,
6668
- deps: [Injector],
6669
- useFactory: (injector) => {
6670
- const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
6671
- let initNavigation = false;
6672
- /**
6673
- * Performs the given action once the router finishes its next/current navigation.
6674
- *
6675
- * If the navigation is canceled or errors without a redirect, the navigation is considered
6676
- * complete. If the `NavigationEnd` event emits, the navigation is also considered complete.
6677
- */
6678
- function afterNextNavigation(action) {
6679
- const router = injector.get(Router);
6680
- router.events
6681
- .pipe(filter((e) => e instanceof NavigationEnd || e instanceof NavigationCancel ||
6682
- e instanceof NavigationError), map(e => {
6683
- if (e instanceof NavigationEnd) {
6684
- // Navigation assumed to succeed if we get `ActivationStart`
6685
- return true;
6686
- }
6687
- const redirecting = e instanceof NavigationCancel ?
6688
- (e.code === 0 /* NavigationCancellationCode.Redirect */ ||
6689
- e.code === 1 /* NavigationCancellationCode.SupersededByNewNavigation */) :
6690
- false;
6691
- return redirecting ? null : false;
6692
- }), filter((result) => result !== null), take(1))
6693
- .subscribe(() => {
6694
- action();
6695
- });
6696
- }
6697
- return () => {
6698
- return locationInitialized.then(() => {
6699
- return new Promise(resolve => {
6700
- const router = injector.get(Router);
6701
- const bootstrapDone = injector.get(BOOTSTRAP_DONE);
6702
- afterNextNavigation(() => {
6703
- // Unblock APP_INITIALIZER in case the initial navigation was canceled or errored
6704
- // without a redirect.
6705
- resolve(true);
6706
- initNavigation = true;
6707
- });
6708
- router.afterPreactivation = () => {
6709
- // Unblock APP_INITIALIZER once we get to `afterPreactivation`. At this point, we
6710
- // assume activation will complete successfully (even though this is not
6711
- // guaranteed).
6712
- resolve(true);
6713
- // only the initial navigation should be delayed until bootstrapping is done.
6714
- if (!initNavigation) {
6715
- return bootstrapDone.closed ? of(void 0) : bootstrapDone;
6716
- // subsequent navigations should not be delayed
6717
- }
6718
- else {
6719
- return of(void 0);
6720
- }
6721
- };
6722
- router.initialNavigation();
6723
- });
6724
- });
6725
- };
6726
- }
6727
- },
6728
- ];
6729
- }
6730
- const INITIAL_NAVIGATION = new InjectionToken(NG_DEV_MODE ? 'initial navigation' : '', { providedIn: 'root', factory: () => 1 /* InitialNavigation.EnabledNonBlocking */ });
6731
- function provideDisabledInitialNavigation() {
6732
- return [
6733
- {
6734
- provide: APP_INITIALIZER,
6735
- multi: true,
6736
- useFactory: () => {
6737
- const router = inject(Router);
6738
- return () => {
6739
- router.setUpLocationChangeListener();
6740
- };
6741
- }
6742
- },
6743
- { provide: INITIAL_NAVIGATION, useValue: 2 /* InitialNavigation.Disabled */ }
6744
- ];
6745
- }
6746
- function provideTracing() {
6747
- if (NG_DEV_MODE) {
6748
- return [{
6749
- provide: ENVIRONMENT_INITIALIZER,
6750
- multi: true,
6751
- useFactory: () => {
6752
- const router = inject(Router);
6753
- return () => router.events.subscribe((e) => {
6754
- var _a, _b;
6755
- // tslint:disable:no-console
6756
- (_a = console.group) === null || _a === void 0 ? void 0 : _a.call(console, `Router Event: ${e.constructor.name}`);
6757
- console.log(stringifyEvent(e));
6758
- console.log(e);
6759
- (_b = console.groupEnd) === null || _b === void 0 ? void 0 : _b.call(console);
6760
- // tslint:enable:no-console
6761
- });
6762
- }
6763
- }];
6764
- }
6765
- else {
6766
- return [];
6767
- }
6768
- }
6769
- function providePreloading(preloadingStrategy) {
6770
- return [
6771
- RouterPreloader,
6772
- { provide: ROUTER_PRELOADER, useExisting: RouterPreloader },
6773
- { provide: PreloadingStrategy, useExisting: preloadingStrategy },
6774
- ];
6775
- }
6776
7125
 
6777
7126
  /**
6778
7127
  * @license
@@ -6784,7 +7133,7 @@ function providePreloading(preloadingStrategy) {
6784
7133
  /**
6785
7134
  * @publicApi
6786
7135
  */
6787
- const VERSION = new Version('14.2.0-next.1');
7136
+ const VERSION = new Version('15.0.0-next.0');
6788
7137
 
6789
7138
  /**
6790
7139
  * @license
@@ -6823,5 +7172,5 @@ const VERSION = new Version('14.2.0-next.1');
6823
7172
  * Generated bundle index. Do not edit.
6824
7173
  */
6825
7174
 
6826
- 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, defaultUrlMatcher, provideRoutes, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten, providePreloading as ɵprovidePreloading };
7175
+ 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, defaultUrlMatcher, provideRouter, provideRoutes, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withInMemoryScrolling, withPreloading, withRouterConfig, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten, withPreloading as ɵwithPreloading };
6827
7176
  //# sourceMappingURL=router.mjs.map