@angular/router 21.0.6 → 21.0.7

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 v21.0.6
2
+ * @license Angular v21.0.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -54,21 +54,13 @@ class RouterLink {
54
54
  }));
55
55
  const tagName = el.nativeElement.tagName?.toLowerCase();
56
56
  this.isAnchorElement = tagName === 'a' || tagName === 'area' || !!(typeof customElements === 'object' && customElements.get(tagName)?.observedAttributes?.includes?.('href'));
57
- if (!this.isAnchorElement) {
58
- this.subscribeToNavigationEventsIfNecessary();
59
- } else {
57
+ if (this.isAnchorElement) {
60
58
  this.setTabIndexIfNotOnNativeEl('0');
59
+ this.subscribeToNavigationEventsIfNecessary();
61
60
  }
62
61
  }
63
62
  subscribeToNavigationEventsIfNecessary() {
64
- if (this.subscription !== undefined || !this.isAnchorElement) {
65
- return;
66
- }
67
- let createSubcription = this.preserveFragment;
68
- const dependsOnRouterState = handling => handling === 'merge' || handling === 'preserve';
69
- createSubcription ||= dependsOnRouterState(this.queryParamsHandling);
70
- createSubcription ||= !this.queryParamsHandling && !dependsOnRouterState(this.options?.defaultQueryParamsHandling);
71
- if (!createSubcription) {
63
+ if (this.subscription !== undefined) {
72
64
  return;
73
65
  }
74
66
  this.subscription = this.router.events.subscribe(s => {
@@ -92,7 +84,6 @@ class RouterLink {
92
84
  }
93
85
  if (this.isAnchorElement) {
94
86
  this.updateHref();
95
- this.subscribeToNavigationEventsIfNecessary();
96
87
  }
97
88
  this.onChanges.next(this);
98
89
  }
@@ -166,7 +157,7 @@ class RouterLink {
166
157
  }
167
158
  static ɵfac = i0.ɵɵngDeclareFactory({
168
159
  minVersion: "12.0.0",
169
- version: "21.0.6",
160
+ version: "21.0.7",
170
161
  ngImport: i0,
171
162
  type: RouterLink,
172
163
  deps: [{
@@ -187,7 +178,7 @@ class RouterLink {
187
178
  });
188
179
  static ɵdir = i0.ɵɵngDeclareDirective({
189
180
  minVersion: "16.1.0",
190
- version: "21.0.6",
181
+ version: "21.0.7",
191
182
  type: RouterLink,
192
183
  isStandalone: true,
193
184
  selector: "[routerLink]",
@@ -219,7 +210,7 @@ class RouterLink {
219
210
  }
220
211
  i0.ɵɵngDeclareClassMetadata({
221
212
  minVersion: "12.0.0",
222
- version: "21.0.6",
213
+ version: "21.0.7",
223
214
  ngImport: i0,
224
215
  type: RouterLink,
225
216
  decorators: [{
@@ -395,7 +386,7 @@ class RouterLinkActive {
395
386
  }
396
387
  static ɵfac = i0.ɵɵngDeclareFactory({
397
388
  minVersion: "12.0.0",
398
- version: "21.0.6",
389
+ version: "21.0.7",
399
390
  ngImport: i0,
400
391
  type: RouterLinkActive,
401
392
  deps: [{
@@ -411,7 +402,7 @@ class RouterLinkActive {
411
402
  });
412
403
  static ɵdir = i0.ɵɵngDeclareDirective({
413
404
  minVersion: "14.0.0",
414
- version: "21.0.6",
405
+ version: "21.0.7",
415
406
  type: RouterLinkActive,
416
407
  isStandalone: true,
417
408
  selector: "[routerLinkActive]",
@@ -435,7 +426,7 @@ class RouterLinkActive {
435
426
  }
436
427
  i0.ɵɵngDeclareClassMetadata({
437
428
  minVersion: "12.0.0",
438
- version: "21.0.6",
429
+ version: "21.0.7",
439
430
  ngImport: i0,
440
431
  type: RouterLinkActive,
441
432
  decorators: [{
@@ -486,7 +477,7 @@ class PreloadAllModules {
486
477
  }
487
478
  static ɵfac = i0.ɵɵngDeclareFactory({
488
479
  minVersion: "12.0.0",
489
- version: "21.0.6",
480
+ version: "21.0.7",
490
481
  ngImport: i0,
491
482
  type: PreloadAllModules,
492
483
  deps: [],
@@ -494,7 +485,7 @@ class PreloadAllModules {
494
485
  });
495
486
  static ɵprov = i0.ɵɵngDeclareInjectable({
496
487
  minVersion: "12.0.0",
497
- version: "21.0.6",
488
+ version: "21.0.7",
498
489
  ngImport: i0,
499
490
  type: PreloadAllModules,
500
491
  providedIn: 'root'
@@ -502,7 +493,7 @@ class PreloadAllModules {
502
493
  }
503
494
  i0.ɵɵngDeclareClassMetadata({
504
495
  minVersion: "12.0.0",
505
- version: "21.0.6",
496
+ version: "21.0.7",
506
497
  ngImport: i0,
507
498
  type: PreloadAllModules,
508
499
  decorators: [{
@@ -518,7 +509,7 @@ class NoPreloading {
518
509
  }
519
510
  static ɵfac = i0.ɵɵngDeclareFactory({
520
511
  minVersion: "12.0.0",
521
- version: "21.0.6",
512
+ version: "21.0.7",
522
513
  ngImport: i0,
523
514
  type: NoPreloading,
524
515
  deps: [],
@@ -526,7 +517,7 @@ class NoPreloading {
526
517
  });
527
518
  static ɵprov = i0.ɵɵngDeclareInjectable({
528
519
  minVersion: "12.0.0",
529
- version: "21.0.6",
520
+ version: "21.0.7",
530
521
  ngImport: i0,
531
522
  type: NoPreloading,
532
523
  providedIn: 'root'
@@ -534,7 +525,7 @@ class NoPreloading {
534
525
  }
535
526
  i0.ɵɵngDeclareClassMetadata({
536
527
  minVersion: "12.0.0",
537
- version: "21.0.6",
528
+ version: "21.0.7",
538
529
  ngImport: i0,
539
530
  type: NoPreloading,
540
531
  decorators: [{
@@ -563,15 +554,13 @@ class RouterPreloader {
563
554
  return this.processRoutes(this.injector, this.router.config);
564
555
  }
565
556
  ngOnDestroy() {
566
- if (this.subscription) {
567
- this.subscription.unsubscribe();
568
- }
557
+ this.subscription?.unsubscribe();
569
558
  }
570
559
  processRoutes(injector, routes) {
571
560
  const res = [];
572
561
  for (const route of routes) {
573
562
  if (route.providers && !route._injector) {
574
- route._injector = createEnvironmentInjector(route.providers, injector, `Route: ${route.path}`);
563
+ route._injector = createEnvironmentInjector(route.providers, injector, typeof ngDevMode === 'undefined' || ngDevMode ? `Route: ${route.path}` : '');
575
564
  }
576
565
  const injectorForCurrentRoute = route._injector ?? injector;
577
566
  const injectorForChildren = route._loadedInjector ?? injectorForCurrentRoute;
@@ -610,7 +599,7 @@ class RouterPreloader {
610
599
  }
611
600
  static ɵfac = i0.ɵɵngDeclareFactory({
612
601
  minVersion: "12.0.0",
613
- version: "21.0.6",
602
+ version: "21.0.7",
614
603
  ngImport: i0,
615
604
  type: RouterPreloader,
616
605
  deps: [{
@@ -626,7 +615,7 @@ class RouterPreloader {
626
615
  });
627
616
  static ɵprov = i0.ɵɵngDeclareInjectable({
628
617
  minVersion: "12.0.0",
629
- version: "21.0.6",
618
+ version: "21.0.7",
630
619
  ngImport: i0,
631
620
  type: RouterPreloader,
632
621
  providedIn: 'root'
@@ -634,7 +623,7 @@ class RouterPreloader {
634
623
  }
635
624
  i0.ɵɵngDeclareClassMetadata({
636
625
  minVersion: "12.0.0",
637
- version: "21.0.6",
626
+ version: "21.0.7",
638
627
  ngImport: i0,
639
628
  type: RouterPreloader,
640
629
  decorators: [{
@@ -739,7 +728,7 @@ class RouterScroller {
739
728
  }
740
729
  static ɵfac = i0.ɵɵngDeclareFactory({
741
730
  minVersion: "12.0.0",
742
- version: "21.0.6",
731
+ version: "21.0.7",
743
732
  ngImport: i0,
744
733
  type: RouterScroller,
745
734
  deps: "invalid",
@@ -747,14 +736,14 @@ class RouterScroller {
747
736
  });
748
737
  static ɵprov = i0.ɵɵngDeclareInjectable({
749
738
  minVersion: "12.0.0",
750
- version: "21.0.6",
739
+ version: "21.0.7",
751
740
  ngImport: i0,
752
741
  type: RouterScroller
753
742
  });
754
743
  }
755
744
  i0.ɵɵngDeclareClassMetadata({
756
745
  minVersion: "12.0.0",
757
- version: "21.0.6",
746
+ version: "21.0.7",
758
747
  ngImport: i0,
759
748
  type: RouterScroller,
760
749
  decorators: [{
@@ -800,7 +789,7 @@ class NavigationStateManager extends HistoryStateManager {
800
789
  }
801
790
  static ɵfac = i0.ɵɵngDeclareFactory({
802
791
  minVersion: "12.0.0",
803
- version: "21.0.6",
792
+ version: "21.0.7",
804
793
  ngImport: i0,
805
794
  type: NavigationStateManager,
806
795
  deps: null,
@@ -808,7 +797,7 @@ class NavigationStateManager extends HistoryStateManager {
808
797
  });
809
798
  static ɵprov = i0.ɵɵngDeclareInjectable({
810
799
  minVersion: "12.0.0",
811
- version: "21.0.6",
800
+ version: "21.0.7",
812
801
  ngImport: i0,
813
802
  type: NavigationStateManager,
814
803
  providedIn: 'root'
@@ -816,7 +805,7 @@ class NavigationStateManager extends HistoryStateManager {
816
805
  }
817
806
  i0.ɵɵngDeclareClassMetadata({
818
807
  minVersion: "12.0.0",
819
- version: "21.0.6",
808
+ version: "21.0.7",
820
809
  ngImport: i0,
821
810
  type: NavigationStateManager,
822
811
  decorators: [{
@@ -1109,7 +1098,7 @@ class RouterModule {
1109
1098
  }
1110
1099
  static ɵfac = i0.ɵɵngDeclareFactory({
1111
1100
  minVersion: "12.0.0",
1112
- version: "21.0.6",
1101
+ version: "21.0.7",
1113
1102
  ngImport: i0,
1114
1103
  type: RouterModule,
1115
1104
  deps: [],
@@ -1117,7 +1106,7 @@ class RouterModule {
1117
1106
  });
1118
1107
  static ɵmod = i0.ɵɵngDeclareNgModule({
1119
1108
  minVersion: "14.0.0",
1120
- version: "21.0.6",
1109
+ version: "21.0.7",
1121
1110
  ngImport: i0,
1122
1111
  type: RouterModule,
1123
1112
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1125,14 +1114,14 @@ class RouterModule {
1125
1114
  });
1126
1115
  static ɵinj = i0.ɵɵngDeclareInjector({
1127
1116
  minVersion: "12.0.0",
1128
- version: "21.0.6",
1117
+ version: "21.0.7",
1129
1118
  ngImport: i0,
1130
1119
  type: RouterModule
1131
1120
  });
1132
1121
  }
1133
1122
  i0.ɵɵngDeclareClassMetadata({
1134
1123
  minVersion: "12.0.0",
1135
- version: "21.0.6",
1124
+ version: "21.0.7",
1136
1125
  ngImport: i0,
1137
1126
  type: RouterModule,
1138
1127
  decorators: [{