@angular/router 21.0.4 → 21.1.0-next.1

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.4
2
+ * @license Angular v21.1.0-next.1
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, isRedirectingEvent, 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
 
@@ -166,7 +166,7 @@ class RouterLink {
166
166
  }
167
167
  static ɵfac = i0.ɵɵngDeclareFactory({
168
168
  minVersion: "12.0.0",
169
- version: "21.0.4",
169
+ version: "21.1.0-next.1",
170
170
  ngImport: i0,
171
171
  type: RouterLink,
172
172
  deps: [{
@@ -187,7 +187,7 @@ class RouterLink {
187
187
  });
188
188
  static ɵdir = i0.ɵɵngDeclareDirective({
189
189
  minVersion: "16.1.0",
190
- version: "21.0.4",
190
+ version: "21.1.0-next.1",
191
191
  type: RouterLink,
192
192
  isStandalone: true,
193
193
  selector: "[routerLink]",
@@ -219,7 +219,7 @@ class RouterLink {
219
219
  }
220
220
  i0.ɵɵngDeclareClassMetadata({
221
221
  minVersion: "12.0.0",
222
- version: "21.0.4",
222
+ version: "21.1.0-next.1",
223
223
  ngImport: i0,
224
224
  type: RouterLink,
225
225
  decorators: [{
@@ -395,7 +395,7 @@ class RouterLinkActive {
395
395
  }
396
396
  static ɵfac = i0.ɵɵngDeclareFactory({
397
397
  minVersion: "12.0.0",
398
- version: "21.0.4",
398
+ version: "21.1.0-next.1",
399
399
  ngImport: i0,
400
400
  type: RouterLinkActive,
401
401
  deps: [{
@@ -411,7 +411,7 @@ class RouterLinkActive {
411
411
  });
412
412
  static ɵdir = i0.ɵɵngDeclareDirective({
413
413
  minVersion: "14.0.0",
414
- version: "21.0.4",
414
+ version: "21.1.0-next.1",
415
415
  type: RouterLinkActive,
416
416
  isStandalone: true,
417
417
  selector: "[routerLinkActive]",
@@ -435,7 +435,7 @@ class RouterLinkActive {
435
435
  }
436
436
  i0.ɵɵngDeclareClassMetadata({
437
437
  minVersion: "12.0.0",
438
- version: "21.0.4",
438
+ version: "21.1.0-next.1",
439
439
  ngImport: i0,
440
440
  type: RouterLinkActive,
441
441
  decorators: [{
@@ -486,7 +486,7 @@ class PreloadAllModules {
486
486
  }
487
487
  static ɵfac = i0.ɵɵngDeclareFactory({
488
488
  minVersion: "12.0.0",
489
- version: "21.0.4",
489
+ version: "21.1.0-next.1",
490
490
  ngImport: i0,
491
491
  type: PreloadAllModules,
492
492
  deps: [],
@@ -494,7 +494,7 @@ class PreloadAllModules {
494
494
  });
495
495
  static ɵprov = i0.ɵɵngDeclareInjectable({
496
496
  minVersion: "12.0.0",
497
- version: "21.0.4",
497
+ version: "21.1.0-next.1",
498
498
  ngImport: i0,
499
499
  type: PreloadAllModules,
500
500
  providedIn: 'root'
@@ -502,7 +502,7 @@ class PreloadAllModules {
502
502
  }
503
503
  i0.ɵɵngDeclareClassMetadata({
504
504
  minVersion: "12.0.0",
505
- version: "21.0.4",
505
+ version: "21.1.0-next.1",
506
506
  ngImport: i0,
507
507
  type: PreloadAllModules,
508
508
  decorators: [{
@@ -518,7 +518,7 @@ class NoPreloading {
518
518
  }
519
519
  static ɵfac = i0.ɵɵngDeclareFactory({
520
520
  minVersion: "12.0.0",
521
- version: "21.0.4",
521
+ version: "21.1.0-next.1",
522
522
  ngImport: i0,
523
523
  type: NoPreloading,
524
524
  deps: [],
@@ -526,7 +526,7 @@ class NoPreloading {
526
526
  });
527
527
  static ɵprov = i0.ɵɵngDeclareInjectable({
528
528
  minVersion: "12.0.0",
529
- version: "21.0.4",
529
+ version: "21.1.0-next.1",
530
530
  ngImport: i0,
531
531
  type: NoPreloading,
532
532
  providedIn: 'root'
@@ -534,7 +534,7 @@ class NoPreloading {
534
534
  }
535
535
  i0.ɵɵngDeclareClassMetadata({
536
536
  minVersion: "12.0.0",
537
- version: "21.0.4",
537
+ version: "21.1.0-next.1",
538
538
  ngImport: i0,
539
539
  type: NoPreloading,
540
540
  decorators: [{
@@ -610,7 +610,7 @@ class RouterPreloader {
610
610
  }
611
611
  static ɵfac = i0.ɵɵngDeclareFactory({
612
612
  minVersion: "12.0.0",
613
- version: "21.0.4",
613
+ version: "21.1.0-next.1",
614
614
  ngImport: i0,
615
615
  type: RouterPreloader,
616
616
  deps: [{
@@ -626,7 +626,7 @@ class RouterPreloader {
626
626
  });
627
627
  static ɵprov = i0.ɵɵngDeclareInjectable({
628
628
  minVersion: "12.0.0",
629
- version: "21.0.4",
629
+ version: "21.1.0-next.1",
630
630
  ngImport: i0,
631
631
  type: RouterPreloader,
632
632
  providedIn: 'root'
@@ -634,7 +634,7 @@ class RouterPreloader {
634
634
  }
635
635
  i0.ɵɵngDeclareClassMetadata({
636
636
  minVersion: "12.0.0",
637
- version: "21.0.4",
637
+ version: "21.1.0-next.1",
638
638
  ngImport: i0,
639
639
  type: RouterPreloader,
640
640
  decorators: [{
@@ -656,10 +656,6 @@ i0.ɵɵngDeclareClassMetadata({
656
656
 
657
657
  const ROUTER_SCROLLER = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Router Scroller' : '');
658
658
  class RouterScroller {
659
- urlSerializer;
660
- transitions;
661
- viewportScroller;
662
- zone;
663
659
  options;
664
660
  routerEventsSubscription;
665
661
  scrollEventsSubscription;
@@ -667,14 +663,14 @@ class RouterScroller {
667
663
  lastSource = IMPERATIVE_NAVIGATION;
668
664
  restoredId = 0;
669
665
  store = {};
670
- constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) {
671
- this.urlSerializer = urlSerializer;
672
- this.transitions = transitions;
673
- this.viewportScroller = viewportScroller;
674
- this.zone = zone;
666
+ urlSerializer = inject(UrlSerializer);
667
+ zone = inject(NgZone);
668
+ viewportScroller = inject(ViewportScroller);
669
+ transitions = inject(NavigationTransitions);
670
+ constructor(options) {
675
671
  this.options = options;
676
- options.scrollPositionRestoration ||= 'disabled';
677
- options.anchorScrolling ||= 'disabled';
672
+ this.options.scrollPositionRestoration ||= 'disabled';
673
+ this.options.anchorScrolling ||= 'disabled';
678
674
  }
679
675
  init() {
680
676
  if (this.options.scrollPositionRestoration !== 'disabled') {
@@ -701,7 +697,7 @@ class RouterScroller {
701
697
  }
702
698
  consumeScrollEvents() {
703
699
  return this.transitions.events.subscribe(e => {
704
- if (!(e instanceof Scroll)) return;
700
+ if (!(e instanceof Scroll) || e.scrollBehavior === 'manual') return;
705
701
  const instantScroll = {
706
702
  behavior: 'instant'
707
703
  };
@@ -721,6 +717,7 @@ class RouterScroller {
721
717
  });
722
718
  }
723
719
  scheduleScrollEvent(routerEvent, anchor) {
720
+ const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll;
724
721
  this.zone.runOutsideAngular(async () => {
725
722
  await new Promise(resolve => {
726
723
  setTimeout(resolve);
@@ -729,7 +726,7 @@ class RouterScroller {
729
726
  }
730
727
  });
731
728
  this.zone.run(() => {
732
- this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));
729
+ this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor, scroll));
733
730
  });
734
731
  });
735
732
  }
@@ -739,7 +736,7 @@ class RouterScroller {
739
736
  }
740
737
  static ɵfac = i0.ɵɵngDeclareFactory({
741
738
  minVersion: "12.0.0",
742
- version: "21.0.4",
739
+ version: "21.1.0-next.1",
743
740
  ngImport: i0,
744
741
  type: RouterScroller,
745
742
  deps: "invalid",
@@ -747,28 +744,20 @@ class RouterScroller {
747
744
  });
748
745
  static ɵprov = i0.ɵɵngDeclareInjectable({
749
746
  minVersion: "12.0.0",
750
- version: "21.0.4",
747
+ version: "21.1.0-next.1",
751
748
  ngImport: i0,
752
749
  type: RouterScroller
753
750
  });
754
751
  }
755
752
  i0.ɵɵngDeclareClassMetadata({
756
753
  minVersion: "12.0.0",
757
- version: "21.0.4",
754
+ version: "21.1.0-next.1",
758
755
  ngImport: i0,
759
756
  type: RouterScroller,
760
757
  decorators: [{
761
758
  type: Injectable
762
759
  }],
763
760
  ctorParameters: () => [{
764
- type: UrlSerializer
765
- }, {
766
- type: NavigationTransitions
767
- }, {
768
- type: i3.ViewportScroller
769
- }, {
770
- type: i0.NgZone
771
- }, {
772
761
  type: undefined
773
762
  }]
774
763
  });
@@ -788,27 +777,227 @@ function navigateByUrl(router, url) {
788
777
  return router.navigateByUrl(url);
789
778
  }
790
779
 
791
- class NavigationStateManager extends HistoryStateManager {
780
+ class NavigationStateManager extends StateManager {
781
+ injector = inject(EnvironmentInjector);
792
782
  navigation = inject(PlatformNavigation);
783
+ inMemoryScrollingEnabled = inject(ROUTER_SCROLLER, {
784
+ optional: true
785
+ }) !== null;
786
+ base = new URL(inject(PlatformLocation).href).origin;
787
+ appRootURL = new URL(this.location.prepareExternalUrl?.('/') ?? '/', this.base).href;
788
+ activeHistoryEntry = this.navigation.currentEntry;
789
+ currentNavigation = {};
790
+ nonRouterCurrentEntryChangeSubject = new Subject();
791
+ nonRouterEntryChangeListener;
792
+ get registered() {
793
+ return this.nonRouterEntryChangeListener !== undefined && !this.nonRouterEntryChangeListener.closed;
794
+ }
795
+ constructor() {
796
+ super();
797
+ const navigateListener = event => {
798
+ this.handleNavigate(event);
799
+ };
800
+ this.navigation.addEventListener('navigate', navigateListener);
801
+ inject(DestroyRef).onDestroy(() => this.navigation.removeEventListener('navigate', navigateListener));
802
+ }
793
803
  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');
804
+ this.activeHistoryEntry = this.navigation.currentEntry;
805
+ this.nonRouterEntryChangeListener = this.nonRouterCurrentEntryChangeSubject.subscribe(({
806
+ path,
807
+ state
808
+ }) => {
809
+ listener(path, state, 'popstate');
810
+ });
811
+ return this.nonRouterEntryChangeListener;
812
+ }
813
+ async handleRouterEvent(e, transition) {
814
+ this.currentNavigation = {
815
+ ...this.currentNavigation,
816
+ routerTransition: transition
817
+ };
818
+ if (e instanceof NavigationStart) {
819
+ this.updateStateMemento();
820
+ } else if (e instanceof NavigationSkipped) {
821
+ this.finishNavigation();
822
+ this.commitTransition(transition);
823
+ } else if (e instanceof RoutesRecognized) {
824
+ if (this.urlUpdateStrategy === 'eager' && !transition.extras.skipLocationChange) {
825
+ this.createNavigationForTransition(transition);
798
826
  }
827
+ } else if (e instanceof BeforeActivateRoutes) {
828
+ this.commitTransition(transition);
829
+ if (this.urlUpdateStrategy === 'deferred' && !transition.extras.skipLocationChange) {
830
+ this.createNavigationForTransition(transition);
831
+ }
832
+ } else if (e instanceof NavigationCancel || e instanceof NavigationError) {
833
+ void this.cancel(transition, e);
834
+ } else if (e instanceof NavigationEnd) {
835
+ const {
836
+ resolveHandler,
837
+ removeAbortListener
838
+ } = this.currentNavigation;
839
+ this.currentNavigation = {};
840
+ removeAbortListener?.();
841
+ this.activeHistoryEntry = this.navigation.currentEntry;
842
+ afterNextRender({
843
+ read: () => resolveHandler?.()
844
+ }, {
845
+ injector: this.injector
846
+ });
847
+ }
848
+ }
849
+ createNavigationForTransition(transition) {
850
+ const {
851
+ navigationEvent
852
+ } = this.currentNavigation;
853
+ if (navigationEvent && (navigationEvent.navigationType === 'traverse' || navigationEvent.navigationType === 'reload') && this.eventAndRouterDestinationsMatch(navigationEvent, transition)) {
854
+ return;
855
+ }
856
+ this.currentNavigation.removeAbortListener?.();
857
+ const path = this.createBrowserPath(transition);
858
+ this.navigate(path, transition);
859
+ }
860
+ navigate(internalPath, transition) {
861
+ const path = transition.extras.skipLocationChange ? this.navigation.currentEntry.url : this.location.prepareExternalUrl(internalPath);
862
+ const state = {
863
+ ...transition.extras.state,
864
+ navigationId: transition.id
865
+ };
866
+ const info = {
867
+ ɵrouterInfo: {
868
+ intercept: true
869
+ }
870
+ };
871
+ const history = this.location.isCurrentPathEqualTo(path) || transition.extras.replaceUrl || transition.extras.skipLocationChange ? 'replace' : 'push';
872
+ handleResultRejections(this.navigation.navigate(path, {
873
+ state,
874
+ history,
875
+ info
876
+ }));
877
+ }
878
+ finishNavigation() {
879
+ this.currentNavigation?.resolveHandler?.();
880
+ this.currentNavigation = {};
881
+ }
882
+ async cancel(transition, cause) {
883
+ this.currentNavigation.rejectNavigateEvent?.();
884
+ const clearedState = {};
885
+ this.currentNavigation = clearedState;
886
+ if (isRedirectingEvent(cause)) {
887
+ return;
888
+ }
889
+ const isTraversalReset = this.canceledNavigationResolution === 'computed' && this.navigation.currentEntry.key !== this.activeHistoryEntry.key;
890
+ this.resetInternalState(transition.finalUrl, isTraversalReset);
891
+ if (this.navigation.currentEntry.id === this.activeHistoryEntry.id) {
892
+ return;
893
+ }
894
+ if (cause instanceof NavigationCancel && cause.code === NavigationCancellationCode.Aborted) {
895
+ await Promise.resolve();
896
+ if (this.currentNavigation !== clearedState) {
897
+ return;
898
+ }
899
+ }
900
+ if (isTraversalReset) {
901
+ handleResultRejections(this.navigation.traverseTo(this.activeHistoryEntry.key, {
902
+ info: {
903
+ ɵrouterInfo: {
904
+ intercept: false
905
+ }
906
+ }
907
+ }));
908
+ } else {
909
+ const internalPath = this.urlSerializer.serialize(this.getCurrentUrlTree());
910
+ const pathOrUrl = this.location.prepareExternalUrl(internalPath);
911
+ handleResultRejections(this.navigation.navigate(pathOrUrl, {
912
+ state: this.activeHistoryEntry.getState(),
913
+ history: 'replace',
914
+ info: {
915
+ ɵrouterInfo: {
916
+ intercept: false
917
+ }
918
+ }
919
+ }));
920
+ }
921
+ }
922
+ resetInternalState(finalUrl, traversalReset) {
923
+ this.routerState = this.stateMemento.routerState;
924
+ this.currentUrlTree = this.stateMemento.currentUrlTree;
925
+ this.rawUrlTree = traversalReset ? this.stateMemento.rawUrlTree : this.urlHandlingStrategy.merge(this.currentUrlTree, finalUrl ?? this.rawUrlTree);
926
+ }
927
+ handleNavigate(event) {
928
+ if (!event.canIntercept) {
929
+ return;
930
+ }
931
+ const routerInfo = event?.info?.ɵrouterInfo;
932
+ if (routerInfo && !routerInfo.intercept) {
933
+ return;
934
+ }
935
+ const isTriggeredByRouterTransition = !!routerInfo;
936
+ if (!isTriggeredByRouterTransition) {
937
+ this.currentNavigation.routerTransition?.abort();
938
+ if (!this.registered) {
939
+ this.finishNavigation();
940
+ return;
941
+ }
942
+ }
943
+ this.currentNavigation = {
944
+ ...this.currentNavigation
945
+ };
946
+ this.currentNavigation.navigationEvent = event;
947
+ const abortHandler = () => {
948
+ this.currentNavigation.routerTransition?.abort();
949
+ };
950
+ event.signal.addEventListener('abort', abortHandler);
951
+ this.currentNavigation.removeAbortListener = () => event.signal.removeEventListener('abort', abortHandler);
952
+ let scroll = this.inMemoryScrollingEnabled ? 'manual' : this.currentNavigation.routerTransition?.extras.scroll ?? 'after-transition';
953
+ const interceptOptions = {
954
+ scroll
955
+ };
956
+ const {
957
+ promise: handlerPromise,
958
+ resolve: resolveHandler,
959
+ reject: rejectHandler
960
+ } = _promiseWithResolvers();
961
+ this.currentNavigation.resolveHandler = () => {
962
+ this.currentNavigation.removeAbortListener?.();
963
+ resolveHandler();
964
+ };
965
+ this.currentNavigation.rejectNavigateEvent = () => {
966
+ this.currentNavigation.removeAbortListener?.();
967
+ rejectHandler();
968
+ };
969
+ handlerPromise.catch(() => {});
970
+ interceptOptions.handler = () => handlerPromise;
971
+ event.intercept(interceptOptions);
972
+ if (!isTriggeredByRouterTransition) {
973
+ this.handleNavigateEventTriggeredOutsideRouterAPIs(event);
974
+ }
975
+ }
976
+ handleNavigateEventTriggeredOutsideRouterAPIs(event) {
977
+ const path = event.destination.url.substring(this.appRootURL.length - 1);
978
+ const state = event.destination.getState();
979
+ this.nonRouterCurrentEntryChangeSubject.next({
980
+ path,
981
+ state
799
982
  });
800
983
  }
984
+ eventAndRouterDestinationsMatch(navigateEvent, transition) {
985
+ const internalPath = this.createBrowserPath(transition);
986
+ const eventDestination = new URL(navigateEvent.destination.url);
987
+ const routerDestination = this.location.prepareExternalUrl(internalPath);
988
+ return new URL(routerDestination, eventDestination.origin).href === eventDestination.href;
989
+ }
801
990
  static ɵfac = i0.ɵɵngDeclareFactory({
802
991
  minVersion: "12.0.0",
803
- version: "21.0.4",
992
+ version: "21.1.0-next.1",
804
993
  ngImport: i0,
805
994
  type: NavigationStateManager,
806
- deps: null,
995
+ deps: [],
807
996
  target: i0.ɵɵFactoryTarget.Injectable
808
997
  });
809
998
  static ɵprov = i0.ɵɵngDeclareInjectable({
810
999
  minVersion: "12.0.0",
811
- version: "21.0.4",
1000
+ version: "21.1.0-next.1",
812
1001
  ngImport: i0,
813
1002
  type: NavigationStateManager,
814
1003
  providedIn: 'root'
@@ -816,7 +1005,7 @@ class NavigationStateManager extends HistoryStateManager {
816
1005
  }
817
1006
  i0.ɵɵngDeclareClassMetadata({
818
1007
  minVersion: "12.0.0",
819
- version: "21.0.4",
1008
+ version: "21.1.0-next.1",
820
1009
  ngImport: i0,
821
1010
  type: NavigationStateManager,
822
1011
  decorators: [{
@@ -824,8 +1013,14 @@ i0.ɵɵngDeclareClassMetadata({
824
1013
  args: [{
825
1014
  providedIn: 'root'
826
1015
  }]
827
- }]
1016
+ }],
1017
+ ctorParameters: () => []
828
1018
  });
1019
+ function handleResultRejections(result) {
1020
+ result.finished.catch(() => {});
1021
+ result.committed.catch(() => {});
1022
+ return result;
1023
+ }
829
1024
 
830
1025
  function provideRouter(routes, ...features) {
831
1026
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
@@ -882,13 +1077,7 @@ function provideRoutes(routes) {
882
1077
  function withInMemoryScrolling(options = {}) {
883
1078
  const providers = [{
884
1079
  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
- }
1080
+ useFactory: () => new RouterScroller(options)
892
1081
  }];
893
1082
  return routerFeature(4, providers);
894
1083
  }
@@ -1109,7 +1298,7 @@ class RouterModule {
1109
1298
  }
1110
1299
  static ɵfac = i0.ɵɵngDeclareFactory({
1111
1300
  minVersion: "12.0.0",
1112
- version: "21.0.4",
1301
+ version: "21.1.0-next.1",
1113
1302
  ngImport: i0,
1114
1303
  type: RouterModule,
1115
1304
  deps: [],
@@ -1117,7 +1306,7 @@ class RouterModule {
1117
1306
  });
1118
1307
  static ɵmod = i0.ɵɵngDeclareNgModule({
1119
1308
  minVersion: "14.0.0",
1120
- version: "21.0.4",
1309
+ version: "21.1.0-next.1",
1121
1310
  ngImport: i0,
1122
1311
  type: RouterModule,
1123
1312
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1125,14 +1314,14 @@ class RouterModule {
1125
1314
  });
1126
1315
  static ɵinj = i0.ɵɵngDeclareInjector({
1127
1316
  minVersion: "12.0.0",
1128
- version: "21.0.4",
1317
+ version: "21.1.0-next.1",
1129
1318
  ngImport: i0,
1130
1319
  type: RouterModule
1131
1320
  });
1132
1321
  }
1133
1322
  i0.ɵɵngDeclareClassMetadata({
1134
1323
  minVersion: "12.0.0",
1135
- version: "21.0.4",
1324
+ version: "21.1.0-next.1",
1136
1325
  ngImport: i0,
1137
1326
  type: RouterModule,
1138
1327
  decorators: [{
@@ -1149,14 +1338,11 @@ function provideRouterScroller() {
1149
1338
  provide: ROUTER_SCROLLER,
1150
1339
  useFactory: () => {
1151
1340
  const viewportScroller = inject(ViewportScroller);
1152
- const zone = inject(NgZone);
1153
1341
  const config = inject(ROUTER_CONFIGURATION);
1154
- const transitions = inject(NavigationTransitions);
1155
- const urlSerializer = inject(UrlSerializer);
1156
1342
  if (config.scrollOffset) {
1157
1343
  viewportScroller.setOffset(config.scrollOffset);
1158
1344
  }
1159
- return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config);
1345
+ return new RouterScroller(config);
1160
1346
  }
1161
1347
  };
1162
1348
  }