@angular/router 21.0.1 → 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.1
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
 
@@ -168,7 +168,7 @@ class RouterLink {
168
168
  }
169
169
  static ɵfac = i0.ɵɵngDeclareFactory({
170
170
  minVersion: "12.0.0",
171
- version: "21.0.1",
171
+ version: "21.1.0-next.0",
172
172
  ngImport: i0,
173
173
  type: RouterLink,
174
174
  deps: [{
@@ -189,7 +189,7 @@ class RouterLink {
189
189
  });
190
190
  static ɵdir = i0.ɵɵngDeclareDirective({
191
191
  minVersion: "16.1.0",
192
- version: "21.0.1",
192
+ version: "21.1.0-next.0",
193
193
  type: RouterLink,
194
194
  isStandalone: true,
195
195
  selector: "[routerLink]",
@@ -221,7 +221,7 @@ class RouterLink {
221
221
  }
222
222
  i0.ɵɵngDeclareClassMetadata({
223
223
  minVersion: "12.0.0",
224
- version: "21.0.1",
224
+ version: "21.1.0-next.0",
225
225
  ngImport: i0,
226
226
  type: RouterLink,
227
227
  decorators: [{
@@ -397,7 +397,7 @@ class RouterLinkActive {
397
397
  }
398
398
  static ɵfac = i0.ɵɵngDeclareFactory({
399
399
  minVersion: "12.0.0",
400
- version: "21.0.1",
400
+ version: "21.1.0-next.0",
401
401
  ngImport: i0,
402
402
  type: RouterLinkActive,
403
403
  deps: [{
@@ -413,7 +413,7 @@ class RouterLinkActive {
413
413
  });
414
414
  static ɵdir = i0.ɵɵngDeclareDirective({
415
415
  minVersion: "14.0.0",
416
- version: "21.0.1",
416
+ version: "21.1.0-next.0",
417
417
  type: RouterLinkActive,
418
418
  isStandalone: true,
419
419
  selector: "[routerLinkActive]",
@@ -437,7 +437,7 @@ class RouterLinkActive {
437
437
  }
438
438
  i0.ɵɵngDeclareClassMetadata({
439
439
  minVersion: "12.0.0",
440
- version: "21.0.1",
440
+ version: "21.1.0-next.0",
441
441
  ngImport: i0,
442
442
  type: RouterLinkActive,
443
443
  decorators: [{
@@ -488,7 +488,7 @@ class PreloadAllModules {
488
488
  }
489
489
  static ɵfac = i0.ɵɵngDeclareFactory({
490
490
  minVersion: "12.0.0",
491
- version: "21.0.1",
491
+ version: "21.1.0-next.0",
492
492
  ngImport: i0,
493
493
  type: PreloadAllModules,
494
494
  deps: [],
@@ -496,7 +496,7 @@ class PreloadAllModules {
496
496
  });
497
497
  static ɵprov = i0.ɵɵngDeclareInjectable({
498
498
  minVersion: "12.0.0",
499
- version: "21.0.1",
499
+ version: "21.1.0-next.0",
500
500
  ngImport: i0,
501
501
  type: PreloadAllModules,
502
502
  providedIn: 'root'
@@ -504,7 +504,7 @@ class PreloadAllModules {
504
504
  }
505
505
  i0.ɵɵngDeclareClassMetadata({
506
506
  minVersion: "12.0.0",
507
- version: "21.0.1",
507
+ version: "21.1.0-next.0",
508
508
  ngImport: i0,
509
509
  type: PreloadAllModules,
510
510
  decorators: [{
@@ -520,7 +520,7 @@ class NoPreloading {
520
520
  }
521
521
  static ɵfac = i0.ɵɵngDeclareFactory({
522
522
  minVersion: "12.0.0",
523
- version: "21.0.1",
523
+ version: "21.1.0-next.0",
524
524
  ngImport: i0,
525
525
  type: NoPreloading,
526
526
  deps: [],
@@ -528,7 +528,7 @@ class NoPreloading {
528
528
  });
529
529
  static ɵprov = i0.ɵɵngDeclareInjectable({
530
530
  minVersion: "12.0.0",
531
- version: "21.0.1",
531
+ version: "21.1.0-next.0",
532
532
  ngImport: i0,
533
533
  type: NoPreloading,
534
534
  providedIn: 'root'
@@ -536,7 +536,7 @@ class NoPreloading {
536
536
  }
537
537
  i0.ɵɵngDeclareClassMetadata({
538
538
  minVersion: "12.0.0",
539
- version: "21.0.1",
539
+ version: "21.1.0-next.0",
540
540
  ngImport: i0,
541
541
  type: NoPreloading,
542
542
  decorators: [{
@@ -612,7 +612,7 @@ class RouterPreloader {
612
612
  }
613
613
  static ɵfac = i0.ɵɵngDeclareFactory({
614
614
  minVersion: "12.0.0",
615
- version: "21.0.1",
615
+ version: "21.1.0-next.0",
616
616
  ngImport: i0,
617
617
  type: RouterPreloader,
618
618
  deps: [{
@@ -628,7 +628,7 @@ class RouterPreloader {
628
628
  });
629
629
  static ɵprov = i0.ɵɵngDeclareInjectable({
630
630
  minVersion: "12.0.0",
631
- version: "21.0.1",
631
+ version: "21.1.0-next.0",
632
632
  ngImport: i0,
633
633
  type: RouterPreloader,
634
634
  providedIn: 'root'
@@ -636,7 +636,7 @@ class RouterPreloader {
636
636
  }
637
637
  i0.ɵɵngDeclareClassMetadata({
638
638
  minVersion: "12.0.0",
639
- version: "21.0.1",
639
+ version: "21.1.0-next.0",
640
640
  ngImport: i0,
641
641
  type: RouterPreloader,
642
642
  decorators: [{
@@ -658,10 +658,6 @@ i0.ɵɵngDeclareClassMetadata({
658
658
 
659
659
  const ROUTER_SCROLLER = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Router Scroller' : '');
660
660
  class RouterScroller {
661
- urlSerializer;
662
- transitions;
663
- viewportScroller;
664
- zone;
665
661
  options;
666
662
  routerEventsSubscription;
667
663
  scrollEventsSubscription;
@@ -669,14 +665,14 @@ class RouterScroller {
669
665
  lastSource = IMPERATIVE_NAVIGATION;
670
666
  restoredId = 0;
671
667
  store = {};
672
- constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) {
673
- this.urlSerializer = urlSerializer;
674
- this.transitions = transitions;
675
- this.viewportScroller = viewportScroller;
676
- this.zone = zone;
668
+ urlSerializer = inject(UrlSerializer);
669
+ zone = inject(NgZone);
670
+ viewportScroller = inject(ViewportScroller);
671
+ transitions = inject(NavigationTransitions);
672
+ constructor(options) {
677
673
  this.options = options;
678
- options.scrollPositionRestoration ||= 'disabled';
679
- options.anchorScrolling ||= 'disabled';
674
+ this.options.scrollPositionRestoration ||= 'disabled';
675
+ this.options.anchorScrolling ||= 'disabled';
680
676
  }
681
677
  init() {
682
678
  if (this.options.scrollPositionRestoration !== 'disabled') {
@@ -703,7 +699,7 @@ class RouterScroller {
703
699
  }
704
700
  consumeScrollEvents() {
705
701
  return this.transitions.events.subscribe(e => {
706
- if (!(e instanceof Scroll)) return;
702
+ if (!(e instanceof Scroll) || e.scrollBehavior === 'manual') return;
707
703
  const instantScroll = {
708
704
  behavior: 'instant'
709
705
  };
@@ -723,6 +719,7 @@ class RouterScroller {
723
719
  });
724
720
  }
725
721
  scheduleScrollEvent(routerEvent, anchor) {
722
+ const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll;
726
723
  this.zone.runOutsideAngular(async () => {
727
724
  await new Promise(resolve => {
728
725
  setTimeout(resolve);
@@ -731,7 +728,7 @@ class RouterScroller {
731
728
  }
732
729
  });
733
730
  this.zone.run(() => {
734
- 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));
735
732
  });
736
733
  });
737
734
  }
@@ -741,7 +738,7 @@ class RouterScroller {
741
738
  }
742
739
  static ɵfac = i0.ɵɵngDeclareFactory({
743
740
  minVersion: "12.0.0",
744
- version: "21.0.1",
741
+ version: "21.1.0-next.0",
745
742
  ngImport: i0,
746
743
  type: RouterScroller,
747
744
  deps: "invalid",
@@ -749,28 +746,20 @@ class RouterScroller {
749
746
  });
750
747
  static ɵprov = i0.ɵɵngDeclareInjectable({
751
748
  minVersion: "12.0.0",
752
- version: "21.0.1",
749
+ version: "21.1.0-next.0",
753
750
  ngImport: i0,
754
751
  type: RouterScroller
755
752
  });
756
753
  }
757
754
  i0.ɵɵngDeclareClassMetadata({
758
755
  minVersion: "12.0.0",
759
- version: "21.0.1",
756
+ version: "21.1.0-next.0",
760
757
  ngImport: i0,
761
758
  type: RouterScroller,
762
759
  decorators: [{
763
760
  type: Injectable
764
761
  }],
765
762
  ctorParameters: () => [{
766
- type: UrlSerializer
767
- }, {
768
- type: NavigationTransitions
769
- }, {
770
- type: i3.ViewportScroller
771
- }, {
772
- type: i0.NgZone
773
- }, {
774
763
  type: undefined
775
764
  }]
776
765
  });
@@ -790,27 +779,214 @@ function navigateByUrl(router, url) {
790
779
  return router.navigateByUrl(url);
791
780
  }
792
781
 
793
- class NavigationStateManager extends HistoryStateManager {
782
+ class NavigationStateManager extends StateManager {
783
+ injector = inject(EnvironmentInjector);
794
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
+ }
795
805
  registerNonRouterCurrentEntryChangeListener(listener) {
796
- return this.location.subscribe(event => {
797
- if (event['type'] === 'popstate') {
798
- const state = this.navigation.currentEntry?.getState();
799
- 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
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;
800
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
801
977
  });
802
978
  }
803
979
  static ɵfac = i0.ɵɵngDeclareFactory({
804
980
  minVersion: "12.0.0",
805
- version: "21.0.1",
981
+ version: "21.1.0-next.0",
806
982
  ngImport: i0,
807
983
  type: NavigationStateManager,
808
- deps: null,
984
+ deps: [],
809
985
  target: i0.ɵɵFactoryTarget.Injectable
810
986
  });
811
987
  static ɵprov = i0.ɵɵngDeclareInjectable({
812
988
  minVersion: "12.0.0",
813
- version: "21.0.1",
989
+ version: "21.1.0-next.0",
814
990
  ngImport: i0,
815
991
  type: NavigationStateManager,
816
992
  providedIn: 'root'
@@ -818,7 +994,7 @@ class NavigationStateManager extends HistoryStateManager {
818
994
  }
819
995
  i0.ɵɵngDeclareClassMetadata({
820
996
  minVersion: "12.0.0",
821
- version: "21.0.1",
997
+ version: "21.1.0-next.0",
822
998
  ngImport: i0,
823
999
  type: NavigationStateManager,
824
1000
  decorators: [{
@@ -826,8 +1002,14 @@ i0.ɵɵngDeclareClassMetadata({
826
1002
  args: [{
827
1003
  providedIn: 'root'
828
1004
  }]
829
- }]
1005
+ }],
1006
+ ctorParameters: () => []
830
1007
  });
1008
+ function handleResultRejections(result) {
1009
+ result.finished.catch(() => {});
1010
+ result.committed.catch(() => {});
1011
+ return result;
1012
+ }
831
1013
 
832
1014
  function provideRouter(routes, ...features) {
833
1015
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
@@ -884,13 +1066,7 @@ function provideRoutes(routes) {
884
1066
  function withInMemoryScrolling(options = {}) {
885
1067
  const providers = [{
886
1068
  provide: ROUTER_SCROLLER,
887
- useFactory: () => {
888
- const viewportScroller = inject(ViewportScroller);
889
- const zone = inject(NgZone);
890
- const transitions = inject(NavigationTransitions);
891
- const urlSerializer = inject(UrlSerializer);
892
- return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, options);
893
- }
1069
+ useFactory: () => new RouterScroller(options)
894
1070
  }];
895
1071
  return routerFeature(4, providers);
896
1072
  }
@@ -1111,7 +1287,7 @@ class RouterModule {
1111
1287
  }
1112
1288
  static ɵfac = i0.ɵɵngDeclareFactory({
1113
1289
  minVersion: "12.0.0",
1114
- version: "21.0.1",
1290
+ version: "21.1.0-next.0",
1115
1291
  ngImport: i0,
1116
1292
  type: RouterModule,
1117
1293
  deps: [],
@@ -1119,7 +1295,7 @@ class RouterModule {
1119
1295
  });
1120
1296
  static ɵmod = i0.ɵɵngDeclareNgModule({
1121
1297
  minVersion: "14.0.0",
1122
- version: "21.0.1",
1298
+ version: "21.1.0-next.0",
1123
1299
  ngImport: i0,
1124
1300
  type: RouterModule,
1125
1301
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1127,14 +1303,14 @@ class RouterModule {
1127
1303
  });
1128
1304
  static ɵinj = i0.ɵɵngDeclareInjector({
1129
1305
  minVersion: "12.0.0",
1130
- version: "21.0.1",
1306
+ version: "21.1.0-next.0",
1131
1307
  ngImport: i0,
1132
1308
  type: RouterModule
1133
1309
  });
1134
1310
  }
1135
1311
  i0.ɵɵngDeclareClassMetadata({
1136
1312
  minVersion: "12.0.0",
1137
- version: "21.0.1",
1313
+ version: "21.1.0-next.0",
1138
1314
  ngImport: i0,
1139
1315
  type: RouterModule,
1140
1316
  decorators: [{
@@ -1151,14 +1327,11 @@ function provideRouterScroller() {
1151
1327
  provide: ROUTER_SCROLLER,
1152
1328
  useFactory: () => {
1153
1329
  const viewportScroller = inject(ViewportScroller);
1154
- const zone = inject(NgZone);
1155
1330
  const config = inject(ROUTER_CONFIGURATION);
1156
- const transitions = inject(NavigationTransitions);
1157
- const urlSerializer = inject(UrlSerializer);
1158
1331
  if (config.scrollOffset) {
1159
1332
  viewportScroller.setOffset(config.scrollOffset);
1160
1333
  }
1161
- return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config);
1334
+ return new RouterScroller(config);
1162
1335
  }
1163
1336
  };
1164
1337
  }