@angular/router 21.0.0 → 21.1.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.
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Angular v21.0.0
2
+ * @license Angular v21.1.0-next.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import * as i3 from '@angular/common';
8
- import { PlatformNavigation, Location, ɵNavigationAdapterForLocation as _NavigationAdapterForLocation, LOCATION_INITIALIZED, ViewportScroller, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
8
+ import { ViewportScroller, PlatformNavigation, PlatformLocation, Location, ɵNavigationAdapterForLocation as _NavigationAdapterForLocation, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
9
9
  import * as i0 from '@angular/core';
10
- import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideEnvironmentInitializer, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgZone, NgModule } from '@angular/core';
11
- import { ROUTER_CONFIGURATION, NavigationEnd, isUrlTree, Router, ActivatedRoute, RouterConfigLoader, IMPERATIVE_NAVIGATION, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, UrlSerializer, NavigationTransitions, HistoryStateManager, ROUTES, afterNextNavigation, StateManager, stringifyEvent, NAVIGATION_ERROR_HANDLER, RoutedComponentInputBinder, INPUT_BINDER, CREATE_VIEW_TRANSITION, createViewTransition, VIEW_TRANSITION_OPTIONS, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './_router-chunk.mjs';
10
+ import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, NgZone, EnvironmentInjector, DestroyRef, afterNextRender, ɵpromiseWithResolvers as _promiseWithResolvers, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideEnvironmentInitializer, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgModule } from '@angular/core';
11
+ import { ROUTER_CONFIGURATION, NavigationEnd, isUrlTree, Router, ActivatedRoute, RouterConfigLoader, IMPERATIVE_NAVIGATION, UrlSerializer, NavigationTransitions, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, StateManager, RoutesRecognized, BeforeActivateRoutes, NavigationCancel, NavigationError, NavigationCancellationCode, ROUTES, afterNextNavigation, stringifyEvent, NAVIGATION_ERROR_HANDLER, RoutedComponentInputBinder, INPUT_BINDER, CREATE_VIEW_TRANSITION, createViewTransition, VIEW_TRANSITION_OPTIONS, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './_router-chunk.mjs';
12
12
  import { Subject, of, from } from 'rxjs';
13
13
  import { mergeAll, catchError, filter, concatMap, mergeMap } from 'rxjs/operators';
14
14
 
@@ -19,9 +19,11 @@ class RouterLink {
19
19
  renderer;
20
20
  el;
21
21
  locationStrategy;
22
- reactiveHref = signal(null, ...(ngDevMode ? [{
23
- debugName: "reactiveHref"
24
- }] : []));
22
+ reactiveHref = signal(null, {
23
+ ...(ngDevMode ? {
24
+ debugName: "reactiveHref"
25
+ } : {})
26
+ });
25
27
  get href() {
26
28
  return untracked(this.reactiveHref);
27
29
  }
@@ -166,7 +168,7 @@ class RouterLink {
166
168
  }
167
169
  static ɵfac = i0.ɵɵngDeclareFactory({
168
170
  minVersion: "12.0.0",
169
- version: "21.0.0",
171
+ version: "21.1.0-next.0",
170
172
  ngImport: i0,
171
173
  type: RouterLink,
172
174
  deps: [{
@@ -187,7 +189,7 @@ class RouterLink {
187
189
  });
188
190
  static ɵdir = i0.ɵɵngDeclareDirective({
189
191
  minVersion: "16.1.0",
190
- version: "21.0.0",
192
+ version: "21.1.0-next.0",
191
193
  type: RouterLink,
192
194
  isStandalone: true,
193
195
  selector: "[routerLink]",
@@ -219,7 +221,7 @@ class RouterLink {
219
221
  }
220
222
  i0.ɵɵngDeclareClassMetadata({
221
223
  minVersion: "12.0.0",
222
- version: "21.0.0",
224
+ version: "21.1.0-next.0",
223
225
  ngImport: i0,
224
226
  type: RouterLink,
225
227
  decorators: [{
@@ -395,7 +397,7 @@ class RouterLinkActive {
395
397
  }
396
398
  static ɵfac = i0.ɵɵngDeclareFactory({
397
399
  minVersion: "12.0.0",
398
- version: "21.0.0",
400
+ version: "21.1.0-next.0",
399
401
  ngImport: i0,
400
402
  type: RouterLinkActive,
401
403
  deps: [{
@@ -411,7 +413,7 @@ class RouterLinkActive {
411
413
  });
412
414
  static ɵdir = i0.ɵɵngDeclareDirective({
413
415
  minVersion: "14.0.0",
414
- version: "21.0.0",
416
+ version: "21.1.0-next.0",
415
417
  type: RouterLinkActive,
416
418
  isStandalone: true,
417
419
  selector: "[routerLinkActive]",
@@ -435,7 +437,7 @@ class RouterLinkActive {
435
437
  }
436
438
  i0.ɵɵngDeclareClassMetadata({
437
439
  minVersion: "12.0.0",
438
- version: "21.0.0",
440
+ version: "21.1.0-next.0",
439
441
  ngImport: i0,
440
442
  type: RouterLinkActive,
441
443
  decorators: [{
@@ -486,7 +488,7 @@ class PreloadAllModules {
486
488
  }
487
489
  static ɵfac = i0.ɵɵngDeclareFactory({
488
490
  minVersion: "12.0.0",
489
- version: "21.0.0",
491
+ version: "21.1.0-next.0",
490
492
  ngImport: i0,
491
493
  type: PreloadAllModules,
492
494
  deps: [],
@@ -494,7 +496,7 @@ class PreloadAllModules {
494
496
  });
495
497
  static ɵprov = i0.ɵɵngDeclareInjectable({
496
498
  minVersion: "12.0.0",
497
- version: "21.0.0",
499
+ version: "21.1.0-next.0",
498
500
  ngImport: i0,
499
501
  type: PreloadAllModules,
500
502
  providedIn: 'root'
@@ -502,7 +504,7 @@ class PreloadAllModules {
502
504
  }
503
505
  i0.ɵɵngDeclareClassMetadata({
504
506
  minVersion: "12.0.0",
505
- version: "21.0.0",
507
+ version: "21.1.0-next.0",
506
508
  ngImport: i0,
507
509
  type: PreloadAllModules,
508
510
  decorators: [{
@@ -518,7 +520,7 @@ class NoPreloading {
518
520
  }
519
521
  static ɵfac = i0.ɵɵngDeclareFactory({
520
522
  minVersion: "12.0.0",
521
- version: "21.0.0",
523
+ version: "21.1.0-next.0",
522
524
  ngImport: i0,
523
525
  type: NoPreloading,
524
526
  deps: [],
@@ -526,7 +528,7 @@ class NoPreloading {
526
528
  });
527
529
  static ɵprov = i0.ɵɵngDeclareInjectable({
528
530
  minVersion: "12.0.0",
529
- version: "21.0.0",
531
+ version: "21.1.0-next.0",
530
532
  ngImport: i0,
531
533
  type: NoPreloading,
532
534
  providedIn: 'root'
@@ -534,7 +536,7 @@ class NoPreloading {
534
536
  }
535
537
  i0.ɵɵngDeclareClassMetadata({
536
538
  minVersion: "12.0.0",
537
- version: "21.0.0",
539
+ version: "21.1.0-next.0",
538
540
  ngImport: i0,
539
541
  type: NoPreloading,
540
542
  decorators: [{
@@ -610,7 +612,7 @@ class RouterPreloader {
610
612
  }
611
613
  static ɵfac = i0.ɵɵngDeclareFactory({
612
614
  minVersion: "12.0.0",
613
- version: "21.0.0",
615
+ version: "21.1.0-next.0",
614
616
  ngImport: i0,
615
617
  type: RouterPreloader,
616
618
  deps: [{
@@ -626,7 +628,7 @@ class RouterPreloader {
626
628
  });
627
629
  static ɵprov = i0.ɵɵngDeclareInjectable({
628
630
  minVersion: "12.0.0",
629
- version: "21.0.0",
631
+ version: "21.1.0-next.0",
630
632
  ngImport: i0,
631
633
  type: RouterPreloader,
632
634
  providedIn: 'root'
@@ -634,7 +636,7 @@ class RouterPreloader {
634
636
  }
635
637
  i0.ɵɵngDeclareClassMetadata({
636
638
  minVersion: "12.0.0",
637
- version: "21.0.0",
639
+ version: "21.1.0-next.0",
638
640
  ngImport: i0,
639
641
  type: RouterPreloader,
640
642
  decorators: [{
@@ -656,10 +658,6 @@ i0.ɵɵngDeclareClassMetadata({
656
658
 
657
659
  const ROUTER_SCROLLER = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Router Scroller' : '');
658
660
  class RouterScroller {
659
- urlSerializer;
660
- transitions;
661
- viewportScroller;
662
- zone;
663
661
  options;
664
662
  routerEventsSubscription;
665
663
  scrollEventsSubscription;
@@ -667,14 +665,14 @@ class RouterScroller {
667
665
  lastSource = IMPERATIVE_NAVIGATION;
668
666
  restoredId = 0;
669
667
  store = {};
670
- constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) {
671
- this.urlSerializer = urlSerializer;
672
- this.transitions = transitions;
673
- this.viewportScroller = viewportScroller;
674
- this.zone = zone;
668
+ urlSerializer = inject(UrlSerializer);
669
+ zone = inject(NgZone);
670
+ viewportScroller = inject(ViewportScroller);
671
+ transitions = inject(NavigationTransitions);
672
+ constructor(options) {
675
673
  this.options = options;
676
- options.scrollPositionRestoration ||= 'disabled';
677
- options.anchorScrolling ||= 'disabled';
674
+ this.options.scrollPositionRestoration ||= 'disabled';
675
+ this.options.anchorScrolling ||= 'disabled';
678
676
  }
679
677
  init() {
680
678
  if (this.options.scrollPositionRestoration !== 'disabled') {
@@ -701,7 +699,7 @@ class RouterScroller {
701
699
  }
702
700
  consumeScrollEvents() {
703
701
  return this.transitions.events.subscribe(e => {
704
- if (!(e instanceof Scroll)) return;
702
+ if (!(e instanceof Scroll) || e.scrollBehavior === 'manual') return;
705
703
  const instantScroll = {
706
704
  behavior: 'instant'
707
705
  };
@@ -721,6 +719,7 @@ class RouterScroller {
721
719
  });
722
720
  }
723
721
  scheduleScrollEvent(routerEvent, anchor) {
722
+ const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll;
724
723
  this.zone.runOutsideAngular(async () => {
725
724
  await new Promise(resolve => {
726
725
  setTimeout(resolve);
@@ -729,7 +728,7 @@ class RouterScroller {
729
728
  }
730
729
  });
731
730
  this.zone.run(() => {
732
- this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));
731
+ this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor, scroll));
733
732
  });
734
733
  });
735
734
  }
@@ -739,7 +738,7 @@ class RouterScroller {
739
738
  }
740
739
  static ɵfac = i0.ɵɵngDeclareFactory({
741
740
  minVersion: "12.0.0",
742
- version: "21.0.0",
741
+ version: "21.1.0-next.0",
743
742
  ngImport: i0,
744
743
  type: RouterScroller,
745
744
  deps: "invalid",
@@ -747,28 +746,20 @@ class RouterScroller {
747
746
  });
748
747
  static ɵprov = i0.ɵɵngDeclareInjectable({
749
748
  minVersion: "12.0.0",
750
- version: "21.0.0",
749
+ version: "21.1.0-next.0",
751
750
  ngImport: i0,
752
751
  type: RouterScroller
753
752
  });
754
753
  }
755
754
  i0.ɵɵngDeclareClassMetadata({
756
755
  minVersion: "12.0.0",
757
- version: "21.0.0",
756
+ version: "21.1.0-next.0",
758
757
  ngImport: i0,
759
758
  type: RouterScroller,
760
759
  decorators: [{
761
760
  type: Injectable
762
761
  }],
763
762
  ctorParameters: () => [{
764
- type: UrlSerializer
765
- }, {
766
- type: NavigationTransitions
767
- }, {
768
- type: i3.ViewportScroller
769
- }, {
770
- type: i0.NgZone
771
- }, {
772
763
  type: undefined
773
764
  }]
774
765
  });
@@ -788,27 +779,214 @@ function navigateByUrl(router, url) {
788
779
  return router.navigateByUrl(url);
789
780
  }
790
781
 
791
- class NavigationStateManager extends HistoryStateManager {
782
+ class NavigationStateManager extends StateManager {
783
+ injector = inject(EnvironmentInjector);
792
784
  navigation = inject(PlatformNavigation);
785
+ inMemoryScrollingEnabled = inject(ROUTER_SCROLLER, {
786
+ optional: true
787
+ }) !== null;
788
+ base = new URL(inject(PlatformLocation).href).origin;
789
+ appRootURL = new URL(this.location.prepareExternalUrl?.('/') ?? '/', this.base).href;
790
+ activeHistoryEntry = this.navigation.currentEntry;
791
+ currentNavigation = {};
792
+ nonRouterCurrentEntryChangeSubject = new Subject();
793
+ nonRouterEntryChangeListener;
794
+ get registered() {
795
+ return this.nonRouterEntryChangeListener !== undefined && !this.nonRouterEntryChangeListener.closed;
796
+ }
797
+ constructor() {
798
+ super();
799
+ const navigateListener = event => {
800
+ this.handleNavigate(event);
801
+ };
802
+ this.navigation.addEventListener('navigate', navigateListener);
803
+ inject(DestroyRef).onDestroy(() => this.navigation.removeEventListener('navigate', navigateListener));
804
+ }
793
805
  registerNonRouterCurrentEntryChangeListener(listener) {
794
- return this.location.subscribe(event => {
795
- if (event['type'] === 'popstate') {
796
- const state = this.navigation.currentEntry?.getState();
797
- listener(event['url'], state, 'popstate');
806
+ this.activeHistoryEntry = this.navigation.currentEntry;
807
+ this.nonRouterEntryChangeListener = this.nonRouterCurrentEntryChangeSubject.subscribe(({
808
+ path,
809
+ state
810
+ }) => {
811
+ listener(path, state, 'popstate');
812
+ });
813
+ return this.nonRouterEntryChangeListener;
814
+ }
815
+ async handleRouterEvent(e, transition) {
816
+ this.currentNavigation = {
817
+ ...this.currentNavigation,
818
+ routerTransition: transition
819
+ };
820
+ if (e instanceof NavigationStart) {
821
+ this.updateStateMemento();
822
+ } else if (e instanceof NavigationSkipped) {
823
+ this.finishNavigation();
824
+ this.commitTransition(transition);
825
+ } else if (e instanceof RoutesRecognized) {
826
+ if (this.urlUpdateStrategy === 'eager' && !transition.extras.skipLocationChange) {
827
+ this.createNavigationForTransition(transition);
828
+ }
829
+ } else if (e instanceof BeforeActivateRoutes) {
830
+ this.commitTransition(transition);
831
+ if (this.urlUpdateStrategy === 'deferred' && !transition.extras.skipLocationChange) {
832
+ this.createNavigationForTransition(transition);
833
+ }
834
+ } else if (e instanceof NavigationCancel || e instanceof NavigationError) {
835
+ void this.cancel(transition, e);
836
+ } else if (e instanceof NavigationEnd) {
837
+ const {
838
+ resolveHandler,
839
+ removeAbortListener
840
+ } = this.currentNavigation;
841
+ this.currentNavigation = {};
842
+ removeAbortListener?.();
843
+ this.activeHistoryEntry = this.navigation.currentEntry;
844
+ afterNextRender({
845
+ read: () => resolveHandler?.()
846
+ }, {
847
+ injector: this.injector
848
+ });
849
+ }
850
+ }
851
+ createNavigationForTransition(transition) {
852
+ this.currentNavigation.removeAbortListener?.();
853
+ const path = this.createBrowserPath(transition);
854
+ this.navigate(path, transition);
855
+ }
856
+ navigate(internalPath, transition) {
857
+ const path = transition.extras.skipLocationChange ? this.navigation.currentEntry.url : this.location.prepareExternalUrl(internalPath);
858
+ const state = {
859
+ ...transition.extras.state,
860
+ navigationId: transition.id
861
+ };
862
+ const info = {
863
+ ɵrouterInfo: {
864
+ intercept: true
798
865
  }
866
+ };
867
+ const history = this.location.isCurrentPathEqualTo(path) || transition.extras.replaceUrl || transition.extras.skipLocationChange ? 'replace' : 'push';
868
+ handleResultRejections(this.navigation.navigate(path, {
869
+ state,
870
+ history,
871
+ info
872
+ }));
873
+ }
874
+ finishNavigation() {
875
+ this.currentNavigation?.resolveHandler?.();
876
+ this.currentNavigation = {};
877
+ }
878
+ async cancel(transition, cause) {
879
+ this.currentNavigation.rejectNavigateEvent?.();
880
+ const clearedState = {};
881
+ this.currentNavigation = clearedState;
882
+ if (cause instanceof NavigationCancel && (cause.code === NavigationCancellationCode.SupersededByNewNavigation || cause.code === NavigationCancellationCode.Redirect)) {
883
+ return;
884
+ }
885
+ const isTraversalReset = this.canceledNavigationResolution === 'computed' && this.navigation.currentEntry.key !== this.activeHistoryEntry.key;
886
+ this.resetInternalState(transition.finalUrl, isTraversalReset);
887
+ if (this.navigation.currentEntry.id === this.activeHistoryEntry.id) {
888
+ return;
889
+ }
890
+ if (cause instanceof NavigationCancel && cause.code !== NavigationCancellationCode.GuardRejected && cause.code !== NavigationCancellationCode.NoDataFromResolver) {
891
+ await Promise.resolve();
892
+ if (this.currentNavigation !== clearedState) {
893
+ return;
894
+ }
895
+ }
896
+ if (isTraversalReset) {
897
+ handleResultRejections(this.navigation.traverseTo(this.activeHistoryEntry.key, {
898
+ info: {
899
+ ɵrouterInfo: {
900
+ intercept: false
901
+ }
902
+ }
903
+ }));
904
+ } else {
905
+ const internalPath = this.urlSerializer.serialize(this.getCurrentUrlTree());
906
+ const pathOrUrl = this.location.prepareExternalUrl(internalPath);
907
+ handleResultRejections(this.navigation.navigate(pathOrUrl, {
908
+ state: this.activeHistoryEntry.getState(),
909
+ history: 'replace',
910
+ info: {
911
+ ɵrouterInfo: {
912
+ intercept: false
913
+ }
914
+ }
915
+ }));
916
+ }
917
+ }
918
+ resetInternalState(finalUrl, traversalReset) {
919
+ this.routerState = this.stateMemento.routerState;
920
+ this.currentUrlTree = this.stateMemento.currentUrlTree;
921
+ this.rawUrlTree = traversalReset ? this.stateMemento.rawUrlTree : this.urlHandlingStrategy.merge(this.currentUrlTree, finalUrl ?? this.rawUrlTree);
922
+ }
923
+ handleNavigate(event) {
924
+ if (!event.canIntercept) {
925
+ return;
926
+ }
927
+ const routerInfo = event?.info?.ɵrouterInfo;
928
+ if (routerInfo && !routerInfo.intercept) {
929
+ return;
930
+ }
931
+ const isTriggeredByRouterTransition = !!routerInfo;
932
+ if (!isTriggeredByRouterTransition) {
933
+ this.currentNavigation.routerTransition?.abort();
934
+ if (!this.registered) {
935
+ this.finishNavigation();
936
+ return;
937
+ }
938
+ }
939
+ this.currentNavigation = {
940
+ ...this.currentNavigation
941
+ };
942
+ const abortHandler = () => {
943
+ this.currentNavigation.routerTransition?.abort();
944
+ };
945
+ event.signal.addEventListener('abort', abortHandler);
946
+ this.currentNavigation.removeAbortListener = () => event.signal.removeEventListener('abort', abortHandler);
947
+ let scroll = this.inMemoryScrollingEnabled ? 'manual' : this.currentNavigation.routerTransition?.extras.scroll ?? 'after-transition';
948
+ const interceptOptions = {
949
+ scroll
950
+ };
951
+ const {
952
+ promise: handlerPromise,
953
+ resolve: resolveHandler,
954
+ reject: rejectHandler
955
+ } = _promiseWithResolvers();
956
+ this.currentNavigation.resolveHandler = () => {
957
+ this.currentNavigation.removeAbortListener?.();
958
+ resolveHandler();
959
+ };
960
+ this.currentNavigation.rejectNavigateEvent = () => {
961
+ this.currentNavigation.removeAbortListener?.();
962
+ rejectHandler();
963
+ };
964
+ handlerPromise.catch(() => {});
965
+ interceptOptions.handler = () => handlerPromise;
966
+ event.intercept(interceptOptions);
967
+ if (!isTriggeredByRouterTransition) {
968
+ this.handleNavigateEventTriggeredOutsideRouterAPIs(event);
969
+ }
970
+ }
971
+ handleNavigateEventTriggeredOutsideRouterAPIs(event) {
972
+ const path = event.destination.url.substring(this.appRootURL.length - 1);
973
+ const state = event.destination.getState();
974
+ this.nonRouterCurrentEntryChangeSubject.next({
975
+ path,
976
+ state
799
977
  });
800
978
  }
801
979
  static ɵfac = i0.ɵɵngDeclareFactory({
802
980
  minVersion: "12.0.0",
803
- version: "21.0.0",
981
+ version: "21.1.0-next.0",
804
982
  ngImport: i0,
805
983
  type: NavigationStateManager,
806
- deps: null,
984
+ deps: [],
807
985
  target: i0.ɵɵFactoryTarget.Injectable
808
986
  });
809
987
  static ɵprov = i0.ɵɵngDeclareInjectable({
810
988
  minVersion: "12.0.0",
811
- version: "21.0.0",
989
+ version: "21.1.0-next.0",
812
990
  ngImport: i0,
813
991
  type: NavigationStateManager,
814
992
  providedIn: 'root'
@@ -816,7 +994,7 @@ class NavigationStateManager extends HistoryStateManager {
816
994
  }
817
995
  i0.ɵɵngDeclareClassMetadata({
818
996
  minVersion: "12.0.0",
819
- version: "21.0.0",
997
+ version: "21.1.0-next.0",
820
998
  ngImport: i0,
821
999
  type: NavigationStateManager,
822
1000
  decorators: [{
@@ -824,8 +1002,14 @@ i0.ɵɵngDeclareClassMetadata({
824
1002
  args: [{
825
1003
  providedIn: 'root'
826
1004
  }]
827
- }]
1005
+ }],
1006
+ ctorParameters: () => []
828
1007
  });
1008
+ function handleResultRejections(result) {
1009
+ result.finished.catch(() => {});
1010
+ result.committed.catch(() => {});
1011
+ return result;
1012
+ }
829
1013
 
830
1014
  function provideRouter(routes, ...features) {
831
1015
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
@@ -882,13 +1066,7 @@ function provideRoutes(routes) {
882
1066
  function withInMemoryScrolling(options = {}) {
883
1067
  const providers = [{
884
1068
  provide: ROUTER_SCROLLER,
885
- useFactory: () => {
886
- const viewportScroller = inject(ViewportScroller);
887
- const zone = inject(NgZone);
888
- const transitions = inject(NavigationTransitions);
889
- const urlSerializer = inject(UrlSerializer);
890
- return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, options);
891
- }
1069
+ useFactory: () => new RouterScroller(options)
892
1070
  }];
893
1071
  return routerFeature(4, providers);
894
1072
  }
@@ -1109,7 +1287,7 @@ class RouterModule {
1109
1287
  }
1110
1288
  static ɵfac = i0.ɵɵngDeclareFactory({
1111
1289
  minVersion: "12.0.0",
1112
- version: "21.0.0",
1290
+ version: "21.1.0-next.0",
1113
1291
  ngImport: i0,
1114
1292
  type: RouterModule,
1115
1293
  deps: [],
@@ -1117,7 +1295,7 @@ class RouterModule {
1117
1295
  });
1118
1296
  static ɵmod = i0.ɵɵngDeclareNgModule({
1119
1297
  minVersion: "14.0.0",
1120
- version: "21.0.0",
1298
+ version: "21.1.0-next.0",
1121
1299
  ngImport: i0,
1122
1300
  type: RouterModule,
1123
1301
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1125,14 +1303,14 @@ class RouterModule {
1125
1303
  });
1126
1304
  static ɵinj = i0.ɵɵngDeclareInjector({
1127
1305
  minVersion: "12.0.0",
1128
- version: "21.0.0",
1306
+ version: "21.1.0-next.0",
1129
1307
  ngImport: i0,
1130
1308
  type: RouterModule
1131
1309
  });
1132
1310
  }
1133
1311
  i0.ɵɵngDeclareClassMetadata({
1134
1312
  minVersion: "12.0.0",
1135
- version: "21.0.0",
1313
+ version: "21.1.0-next.0",
1136
1314
  ngImport: i0,
1137
1315
  type: RouterModule,
1138
1316
  decorators: [{
@@ -1149,14 +1327,11 @@ function provideRouterScroller() {
1149
1327
  provide: ROUTER_SCROLLER,
1150
1328
  useFactory: () => {
1151
1329
  const viewportScroller = inject(ViewportScroller);
1152
- const zone = inject(NgZone);
1153
1330
  const config = inject(ROUTER_CONFIGURATION);
1154
- const transitions = inject(NavigationTransitions);
1155
- const urlSerializer = inject(UrlSerializer);
1156
1331
  if (config.scrollOffset) {
1157
1332
  viewportScroller.setOffset(config.scrollOffset);
1158
1333
  }
1159
- return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config);
1334
+ return new RouterScroller(config);
1160
1335
  }
1161
1336
  };
1162
1337
  }