@angular/router 18.0.0-next.4 → 18.0.0-next.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.4
2
+ * @license Angular v18.0.0-next.6
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -421,10 +421,10 @@ function mapChildrenIntoArray(segment, fn) {
421
421
  * @publicApi
422
422
  */
423
423
  class UrlSerializer {
424
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
425
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
424
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
425
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }); }
426
426
  }
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlSerializer, decorators: [{
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlSerializer, decorators: [{
428
428
  type: Injectable,
429
429
  args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
430
430
  }] });
@@ -1857,10 +1857,10 @@ class ChildrenOutletContexts {
1857
1857
  getContext(childName) {
1858
1858
  return this.contexts.get(childName) || null;
1859
1859
  }
1860
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: ChildrenOutletContexts, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1861
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
1860
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1861
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' }); }
1862
1862
  }
1863
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
1863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
1864
1864
  type: Injectable,
1865
1865
  args: [{ providedIn: 'root' }]
1866
1866
  }], ctorParameters: () => [{ type: i0.EnvironmentInjector }] });
@@ -2568,10 +2568,10 @@ class RouterOutlet {
2568
2568
  this.inputBinder?.bindActivatedRouteToOutletComponent(this);
2569
2569
  this.activateEvents.emit(this.activated.instance);
2570
2570
  }
2571
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2572
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.4", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
2571
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2572
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.6", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 }); }
2573
2573
  }
2574
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterOutlet, decorators: [{
2574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterOutlet, decorators: [{
2575
2575
  type: Directive,
2576
2576
  args: [{
2577
2577
  selector: 'router-outlet',
@@ -2594,17 +2594,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4",
2594
2594
  args: ['detach']
2595
2595
  }] } });
2596
2596
  class OutletInjector {
2597
+ /**
2598
+ * This injector has a special handing for the `ActivatedRoute` and
2599
+ * `ChildrenOutletContexts` tokens: it returns corresponding values for those
2600
+ * tokens dynamically. This behavior is different from the regular injector logic,
2601
+ * when we initialize and store a value, which is later returned for all inject
2602
+ * requests.
2603
+ *
2604
+ * In some cases (e.g. when using `@defer`), this dynamic behavior requires special
2605
+ * handling. This function allows to identify an instance of the `OutletInjector` and
2606
+ * create an instance of it without referring to the class itself (so this logic can
2607
+ * be invoked from the `core` package). This helps to retain dynamic behavior for the
2608
+ * mentioned tokens.
2609
+ *
2610
+ * Note: it's a temporary solution and we should explore how to support this case better.
2611
+ */
2612
+ __ngOutletInjector(parentInjector) {
2613
+ return new OutletInjector(this.route, this.childContexts, parentInjector);
2614
+ }
2597
2615
  constructor(route, childContexts, parent) {
2598
2616
  this.route = route;
2599
2617
  this.childContexts = childContexts;
2600
2618
  this.parent = parent;
2601
- /**
2602
- * A special flag that allows to identify the `OutletInjector` without
2603
- * referring to the class itself. This is required as a temporary solution,
2604
- * to have a special handling for this injector in core. Eventually, this
2605
- * injector should just become an `EnvironmentInjector` without special logic.
2606
- */
2607
- this.__ngOutletInjector = true;
2608
2619
  }
2609
2620
  get(token, notFoundValue) {
2610
2621
  if (token === ActivatedRoute) {
@@ -2683,10 +2694,10 @@ class RoutedComponentInputBinder {
2683
2694
  });
2684
2695
  this.outletDataSubscriptions.set(outlet, dataSubscription);
2685
2696
  }
2686
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2687
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RoutedComponentInputBinder }); }
2697
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2698
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder }); }
2688
2699
  }
2689
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
2700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RoutedComponentInputBinder, decorators: [{
2690
2701
  type: Injectable
2691
2702
  }] });
2692
2703
 
@@ -2732,6 +2743,44 @@ function createActivatedRoute(c) {
2732
2743
  return new ActivatedRoute(new BehaviorSubject(c.url), new BehaviorSubject(c.params), new BehaviorSubject(c.queryParams), new BehaviorSubject(c.fragment), new BehaviorSubject(c.data), c.outlet, c.component, c);
2733
2744
  }
2734
2745
 
2746
+ /**
2747
+ * Can be returned by a `Router` guard to instruct the `Router` to redirect rather than continue
2748
+ * processing the path of the in-flight navigation. The `redirectTo` indicates _where_ the new
2749
+ * navigation should go to and the optional `navigationBehaviorOptions` can provide more information
2750
+ * about _how_ to perform the navigation.
2751
+ *
2752
+ * ```ts
2753
+ * const route: Route = {
2754
+ * path: "user/:userId",
2755
+ * component: User,
2756
+ * canActivate: [
2757
+ * () => {
2758
+ * const router = inject(Router);
2759
+ * const authService = inject(AuthenticationService);
2760
+ *
2761
+ * if (!authService.isLoggedIn()) {
2762
+ * const loginPath = router.parseUrl("/login");
2763
+ * return new RedirectCommand(loginPath, {
2764
+ * skipLocationChange: "true",
2765
+ * });
2766
+ * }
2767
+ *
2768
+ * return true;
2769
+ * },
2770
+ * ],
2771
+ * };
2772
+ * ```
2773
+ * @see [Routing guide](guide/routing/common-router-tasks#preventing-unauthorized-access)
2774
+ *
2775
+ * @publicApi
2776
+ */
2777
+ class RedirectCommand {
2778
+ constructor(redirectTo, navigationBehaviorOptions) {
2779
+ this.redirectTo = redirectTo;
2780
+ this.navigationBehaviorOptions = navigationBehaviorOptions;
2781
+ }
2782
+ }
2783
+
2735
2784
  const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';
2736
2785
  function redirectingNavigationError(urlSerializer, redirect) {
2737
2786
  const { redirectTo, navigationBehaviorOptions } = isUrlTree(redirect)
@@ -2766,10 +2815,10 @@ function isNavigationCancelingError(error) {
2766
2815
  * to this `EmptyOutletComponent`.
2767
2816
  */
2768
2817
  class ɵEmptyOutletComponent {
2769
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2770
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.4", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
2818
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2819
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0-next.6", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
2771
2820
  }
2772
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2821
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
2773
2822
  type: Component,
2774
2823
  args: [{
2775
2824
  template: `<router-outlet></router-outlet>`,
@@ -3336,22 +3385,6 @@ function isEmptyError(e) {
3336
3385
  return e instanceof EmptyError || e?.name === 'EmptyError';
3337
3386
  }
3338
3387
 
3339
- /**
3340
- * Can be returned by a `Router` guard to instruct the `Router` to redirect rather than continue
3341
- * processing the path of the in-flight navigation. The `redirectTo` indicates _where_ the new
3342
- * navigation should go to and the optional `navigationBehaviorOptions` can provide more information
3343
- * about _how_ to perform the navigation.
3344
- *
3345
- * @see [Routing guide](guide/routing/common-router-tasks#preventing-unauthorized-access)
3346
- * @publicApi
3347
- */
3348
- class RedirectCommand {
3349
- constructor(redirectTo, navigationBehaviorOptions) {
3350
- this.redirectTo = redirectTo;
3351
- this.navigationBehaviorOptions = navigationBehaviorOptions;
3352
- }
3353
- }
3354
-
3355
3388
  const INITIAL_VALUE = /* @__PURE__ */ Symbol('INITIAL_VALUE');
3356
3389
  function prioritizedGuardValue() {
3357
3390
  return switchMap((obs) => {
@@ -4208,10 +4241,10 @@ class TitleStrategy {
4208
4241
  getResolvedTitleForRoute(snapshot) {
4209
4242
  return snapshot.data[RouteTitleKey];
4210
4243
  }
4211
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4212
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
4244
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4245
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }); }
4213
4246
  }
4214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: TitleStrategy, decorators: [{
4247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: TitleStrategy, decorators: [{
4215
4248
  type: Injectable,
4216
4249
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
4217
4250
  }] });
@@ -4234,10 +4267,10 @@ class DefaultTitleStrategy extends TitleStrategy {
4234
4267
  this.title.setTitle(title);
4235
4268
  }
4236
4269
  }
4237
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
4238
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
4270
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
4271
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' }); }
4239
4272
  }
4240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
4241
4274
  type: Injectable,
4242
4275
  args: [{ providedIn: 'root' }]
4243
4276
  }], ctorParameters: () => [{ type: i1.Title }] });
@@ -4313,10 +4346,10 @@ class RouterConfigLoader {
4313
4346
  this.childrenLoaders.set(route, loader);
4314
4347
  return loader;
4315
4348
  }
4316
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4317
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
4349
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterConfigLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4350
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' }); }
4318
4351
  }
4319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterConfigLoader, decorators: [{
4352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterConfigLoader, decorators: [{
4320
4353
  type: Injectable,
4321
4354
  args: [{ providedIn: 'root' }]
4322
4355
  }] });
@@ -4383,10 +4416,10 @@ function maybeUnwrapDefaultExport(input) {
4383
4416
  * @publicApi
4384
4417
  */
4385
4418
  class UrlHandlingStrategy {
4386
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4387
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
4419
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4420
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }); }
4388
4421
  }
4389
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
4422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: UrlHandlingStrategy, decorators: [{
4390
4423
  type: Injectable,
4391
4424
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultUrlHandlingStrategy) }]
4392
4425
  }] });
@@ -4403,10 +4436,10 @@ class DefaultUrlHandlingStrategy {
4403
4436
  merge(newUrlPart, wholeUrl) {
4404
4437
  return newUrlPart;
4405
4438
  }
4406
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4407
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
4439
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4440
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, providedIn: 'root' }); }
4408
4441
  }
4409
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
4442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultUrlHandlingStrategy, decorators: [{
4410
4443
  type: Injectable,
4411
4444
  args: [{ providedIn: 'root' }]
4412
4445
  }] });
@@ -4781,11 +4814,20 @@ class NavigationTransitions {
4781
4814
  }
4782
4815
  else {
4783
4816
  const navigationError = new NavigationError(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), e, overallTransitionState.targetSnapshot ?? undefined);
4784
- this.events.next(navigationError);
4785
4817
  try {
4786
- runInInjectionContext(this.environmentInjector, () => this.navigationErrorHandler?.(navigationError));
4787
- const errorHandlerResult = router.errorHandler(e);
4788
- overallTransitionState.resolve(!!errorHandlerResult);
4818
+ const navigationErrorHandlerResult = runInInjectionContext(this.environmentInjector, () => this.navigationErrorHandler?.(navigationError));
4819
+ if (navigationErrorHandlerResult instanceof RedirectCommand) {
4820
+ const { message, cancellationCode } = redirectingNavigationError(this.urlSerializer, navigationErrorHandlerResult);
4821
+ this.events.next(new NavigationCancel(overallTransitionState.id, this.urlSerializer.serialize(overallTransitionState.extractedUrl), message, cancellationCode));
4822
+ this.events.next(new RedirectRequest(navigationErrorHandlerResult.redirectTo, navigationErrorHandlerResult.navigationBehaviorOptions));
4823
+ }
4824
+ else {
4825
+ this.events.next(navigationError);
4826
+ // TODO(atscott): remove deprecation on errorHandler in RouterModule.forRoot and change behavior to provide NAVIGATION_ERROR_HANDLER
4827
+ // Note: Still remove public `Router.errorHandler` property, as this is supposed to be configured in DI.
4828
+ const errorHandlerResult = router.errorHandler(e);
4829
+ overallTransitionState.resolve(!!errorHandlerResult);
4830
+ }
4789
4831
  }
4790
4832
  catch (ee) {
4791
4833
  // TODO(atscott): consider flipping the default behavior of
@@ -4842,10 +4884,10 @@ class NavigationTransitions {
4842
4884
  return (extractedBrowserUrl.toString() !== this.currentTransition?.extractedUrl.toString() &&
4843
4885
  !this.currentTransition?.extras.skipLocationChange);
4844
4886
  }
4845
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4846
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
4887
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NavigationTransitions, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4888
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NavigationTransitions, providedIn: 'root' }); }
4847
4889
  }
4848
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NavigationTransitions, decorators: [{
4890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NavigationTransitions, decorators: [{
4849
4891
  type: Injectable,
4850
4892
  args: [{ providedIn: 'root' }]
4851
4893
  }], ctorParameters: () => [] });
@@ -4861,10 +4903,10 @@ function isBrowserTriggeredNavigation(source) {
4861
4903
  * @publicApi
4862
4904
  */
4863
4905
  class RouteReuseStrategy {
4864
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4865
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
4906
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4907
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }); }
4866
4908
  }
4867
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouteReuseStrategy, decorators: [{
4909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouteReuseStrategy, decorators: [{
4868
4910
  type: Injectable,
4869
4911
  args: [{ providedIn: 'root', useFactory: () => inject(DefaultRouteReuseStrategy) }]
4870
4912
  }] });
@@ -4915,19 +4957,19 @@ class BaseRouteReuseStrategy {
4915
4957
  }
4916
4958
  }
4917
4959
  class DefaultRouteReuseStrategy extends BaseRouteReuseStrategy {
4918
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4919
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
4960
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4961
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, providedIn: 'root' }); }
4920
4962
  }
4921
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
4963
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: DefaultRouteReuseStrategy, decorators: [{
4922
4964
  type: Injectable,
4923
4965
  args: [{ providedIn: 'root' }]
4924
4966
  }] });
4925
4967
 
4926
4968
  class StateManager {
4927
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: StateManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4928
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: StateManager, providedIn: 'root', useFactory: () => inject(HistoryStateManager) }); }
4969
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: StateManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4970
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: StateManager, providedIn: 'root', useFactory: () => inject(HistoryStateManager) }); }
4929
4971
  }
4930
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: StateManager, decorators: [{
4972
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: StateManager, decorators: [{
4931
4973
  type: Injectable,
4932
4974
  args: [{ providedIn: 'root', useFactory: () => inject(HistoryStateManager) }]
4933
4975
  }] });
@@ -5102,10 +5144,10 @@ class HistoryStateManager extends StateManager {
5102
5144
  }
5103
5145
  return { navigationId };
5104
5146
  }
5105
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: HistoryStateManager, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
5106
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: HistoryStateManager, providedIn: 'root' }); }
5147
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: HistoryStateManager, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
5148
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: HistoryStateManager, providedIn: 'root' }); }
5107
5149
  }
5108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: HistoryStateManager, decorators: [{
5150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: HistoryStateManager, decorators: [{
5109
5151
  type: Injectable,
5110
5152
  args: [{ providedIn: 'root' }]
5111
5153
  }] });
@@ -5205,7 +5247,6 @@ class Router {
5205
5247
  }
5206
5248
  constructor() {
5207
5249
  this.disposed = false;
5208
- this.isNgZoneEnabled = false;
5209
5250
  this.console = inject(ɵConsole);
5210
5251
  this.stateManager = inject(StateManager);
5211
5252
  this.options = inject(ROUTER_CONFIGURATION, { optional: true }) || {};
@@ -5260,7 +5301,6 @@ class Router {
5260
5301
  */
5261
5302
  this.componentInputBindingEnabled = !!inject(INPUT_BINDER, { optional: true });
5262
5303
  this.eventsSubscription = new Subscription();
5263
- this.isNgZoneEnabled = inject(NgZone) instanceof NgZone && NgZone.isInAngularZone();
5264
5304
  this.resetConfig(this.config);
5265
5305
  this.navigationTransitions
5266
5306
  .setupNavigations(this, this.currentUrlTree, this.routerState)
@@ -5560,11 +5600,6 @@ class Router {
5560
5600
  navigateByUrl(url, extras = {
5561
5601
  skipLocationChange: false,
5562
5602
  }) {
5563
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
5564
- if (this.isNgZoneEnabled && !NgZone.isInAngularZone()) {
5565
- this.console.warn(`Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?`);
5566
- }
5567
- }
5568
5603
  const urlTree = isUrlTree(url) ? url : this.parseUrl(url);
5569
5604
  const mergedTree = this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree);
5570
5605
  return this.scheduleNavigation(mergedTree, IMPERATIVE_NAVIGATION, null, extras);
@@ -5685,10 +5720,10 @@ class Router {
5685
5720
  return Promise.reject(e);
5686
5721
  });
5687
5722
  }
5688
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5689
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: Router, providedIn: 'root' }); }
5723
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: Router, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5724
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: Router, providedIn: 'root' }); }
5690
5725
  }
5691
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: Router, decorators: [{
5726
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: Router, decorators: [{
5692
5727
  type: Injectable,
5693
5728
  args: [{ providedIn: 'root' }]
5694
5729
  }], ctorParameters: () => [] });
@@ -5963,10 +5998,10 @@ class RouterLink {
5963
5998
  preserveFragment: this.preserveFragment,
5964
5999
  });
5965
6000
  }
5966
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive }); }
5967
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.4", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", info: "info", relativeTo: "relativeTo", preserveFragment: ["preserveFragment", "preserveFragment", booleanAttribute], skipLocationChange: ["skipLocationChange", "skipLocationChange", booleanAttribute], replaceUrl: ["replaceUrl", "replaceUrl", booleanAttribute], routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
6001
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive }); }
6002
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.6", type: RouterLink, isStandalone: true, selector: "[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", info: "info", relativeTo: "relativeTo", preserveFragment: ["preserveFragment", "preserveFragment", booleanAttribute], skipLocationChange: ["skipLocationChange", "skipLocationChange", booleanAttribute], replaceUrl: ["replaceUrl", "replaceUrl", booleanAttribute], routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 }); }
5968
6003
  }
5969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterLink, decorators: [{
6004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterLink, decorators: [{
5970
6005
  type: Directive,
5971
6006
  args: [{
5972
6007
  selector: '[routerLink]',
@@ -6204,10 +6239,10 @@ class RouterLinkActive {
6204
6239
  const isActiveCheckFn = this.isLinkActive(this.router);
6205
6240
  return (this.link && isActiveCheckFn(this.link)) || this.links.some(isActiveCheckFn);
6206
6241
  }
6207
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
6208
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.4", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 }); }
6242
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
6243
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.6", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 }); }
6209
6244
  }
6210
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterLinkActive, decorators: [{
6245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterLinkActive, decorators: [{
6211
6246
  type: Directive,
6212
6247
  args: [{
6213
6248
  selector: '[routerLinkActive]',
@@ -6259,10 +6294,10 @@ class PreloadAllModules {
6259
6294
  preload(route, fn) {
6260
6295
  return fn().pipe(catchError(() => of(null)));
6261
6296
  }
6262
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6263
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
6297
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6298
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: PreloadAllModules, providedIn: 'root' }); }
6264
6299
  }
6265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: PreloadAllModules, decorators: [{
6300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: PreloadAllModules, decorators: [{
6266
6301
  type: Injectable,
6267
6302
  args: [{ providedIn: 'root' }]
6268
6303
  }] });
@@ -6279,10 +6314,10 @@ class NoPreloading {
6279
6314
  preload(route, fn) {
6280
6315
  return of(null);
6281
6316
  }
6282
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6283
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
6317
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6318
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NoPreloading, providedIn: 'root' }); }
6284
6319
  }
6285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: NoPreloading, decorators: [{
6320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: NoPreloading, decorators: [{
6286
6321
  type: Injectable,
6287
6322
  args: [{ providedIn: 'root' }]
6288
6323
  }] });
@@ -6373,10 +6408,10 @@ class RouterPreloader {
6373
6408
  }
6374
6409
  });
6375
6410
  }
6376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
6377
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
6411
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
6412
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterPreloader, providedIn: 'root' }); }
6378
6413
  }
6379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterPreloader, decorators: [{
6414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterPreloader, decorators: [{
6380
6415
  type: Injectable,
6381
6416
  args: [{ providedIn: 'root' }]
6382
6417
  }], ctorParameters: () => [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }] });
@@ -6469,10 +6504,10 @@ class RouterScroller {
6469
6504
  this.routerEventsSubscription?.unsubscribe();
6470
6505
  this.scrollEventsSubscription?.unsubscribe();
6471
6506
  }
6472
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
6473
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterScroller }); }
6507
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable }); }
6508
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterScroller }); }
6474
6509
  }
6475
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterScroller, decorators: [{
6510
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterScroller, decorators: [{
6476
6511
  type: Injectable
6477
6512
  }], ctorParameters: () => [{ type: UrlSerializer }, { type: NavigationTransitions }, { type: i3.ViewportScroller }, { type: i0.NgZone }, { type: undefined }] });
6478
6513
 
@@ -6899,6 +6934,12 @@ function withHashLocation() {
6899
6934
  * This function is run inside application's [injection context](guide/di/dependency-injection-context)
6900
6935
  * so you can use the [`inject`](api/core/inject) function.
6901
6936
  *
6937
+ * This function can return a `RedirectCommand` to convert the error to a redirect, similar to returning
6938
+ * a `UrlTree` or `RedirectCommand` from a guard. This will also prevent the `Router` from emitting
6939
+ * `NavigationError`; it will instead emit `NavigationCancel` with code NavigationCancellationCode.Redirect.
6940
+ * Return values other than `RedirectCommand` are ignored and do not change any behavior with respect to
6941
+ * how the `Router` handles the error.
6942
+ *
6902
6943
  * @usageNotes
6903
6944
  *
6904
6945
  * Basic example of how you can use the error handler option:
@@ -7113,11 +7154,11 @@ class RouterModule {
7113
7154
  providers: [{ provide: ROUTES, multi: true, useValue: routes }],
7114
7155
  };
7115
7156
  }
7116
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
7117
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
7118
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterModule }); }
7157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
7158
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] }); }
7159
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterModule }); }
7119
7160
  }
7120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.4", ngImport: i0, type: RouterModule, decorators: [{
7161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.6", ngImport: i0, type: RouterModule, decorators: [{
7121
7162
  type: NgModule,
7122
7163
  args: [{
7123
7164
  imports: ROUTER_DIRECTIVES,
@@ -7262,7 +7303,7 @@ function mapToResolve(provider) {
7262
7303
  /**
7263
7304
  * @publicApi
7264
7305
  */
7265
- const VERSION = new Version('18.0.0-next.4');
7306
+ const VERSION = new Version('18.0.0-next.6');
7266
7307
 
7267
7308
  /**
7268
7309
  * @module