@angular/router 21.2.0-next.0 → 21.2.0-next.2

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.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -28,7 +28,7 @@ function mapToResolve(provider) {
28
28
  return (...params) => inject(provider).resolve(...params);
29
29
  }
30
30
 
31
- const VERSION = /* @__PURE__ */new Version('21.2.0-next.0');
31
+ const VERSION = /* @__PURE__ */new Version('21.2.0-next.2');
32
32
 
33
33
  export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };
34
34
  //# sourceMappingURL=router.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/functional_guards.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...params);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.2.0-next.0');\n"],"names":["mapToCanMatch","providers","map","provider","params","inject","canMatch","mapToCanActivate","canActivate","mapToCanActivateChild","canActivateChild","mapToCanDeactivate","canDeactivate","mapToResolve","resolve","VERSION","Version"],"mappings":";;;;;;;;;;;;;;AAgCM,SAAUA,aAAaA,CAACC,SAAgC,EAAA;EAC5D,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACG,QAAQ,CAAC,GAAGF,MAAM,CAAC,CACzC;AACH;AAWM,SAAUG,gBAAgBA,CAACN,SAAmC,EAAA;EAClE,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACK,WAAW,CAAC,GAAGJ,MAAM,CAAC,CAC5C;AACH;AAUM,SAAUK,qBAAqBA,CACnCR,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACO,gBAAgB,CAAC,GAAGN,MAAM,CAAC,CACjD;AACH;AAUM,SAAUO,kBAAkBA,CAChCV,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACS,aAAa,CAAC,GAAGR,MAAM,CAAC,CAC9C;AACH;AAUM,SAAUS,YAAYA,CAAIV,QAA0B,EAAA;AACxD,EAAA,OAAO,CAAC,GAAGC,MAAM,KAAKC,MAAM,CAACF,QAAQ,CAAC,CAACW,OAAO,CAAC,GAAGV,MAAM,CAAC;AAC3D;;ACpFO,MAAMW,OAAO,kBAAmB,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"router.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/utils/functional_guards.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...params);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.2.0-next.2');\n"],"names":["mapToCanMatch","providers","map","provider","params","inject","canMatch","mapToCanActivate","canActivate","mapToCanActivateChild","canActivateChild","mapToCanDeactivate","canDeactivate","mapToResolve","resolve","VERSION","Version"],"mappings":";;;;;;;;;;;;;;AAgCM,SAAUA,aAAaA,CAACC,SAAgC,EAAA;EAC5D,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACG,QAAQ,CAAC,GAAGF,MAAM,CAAC,CACzC;AACH;AAWM,SAAUG,gBAAgBA,CAACN,SAAmC,EAAA;EAClE,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACK,WAAW,CAAC,GAAGJ,MAAM,CAAC,CAC5C;AACH;AAUM,SAAUK,qBAAqBA,CACnCR,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACO,gBAAgB,CAAC,GAAGN,MAAM,CAAC,CACjD;AACH;AAUM,SAAUO,kBAAkBA,CAChCV,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACS,aAAa,CAAC,GAAGR,MAAM,CAAC,CAC9C;AACH;AAUM,SAAUS,YAAYA,CAAIV,QAA0B,EAAA;AACxD,EAAA,OAAO,CAAC,GAAGC,MAAM,KAAKC,MAAM,CAACF,QAAQ,CAAC,CAACW,OAAO,CAAC,GAAGV,MAAM,CAAC;AAC3D;;ACpFO,MAAMW,OAAO,kBAAmB,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -33,7 +33,7 @@ class RouterTestingModule {
33
33
  }
34
34
  static ɵfac = i0.ɵɵngDeclareFactory({
35
35
  minVersion: "12.0.0",
36
- version: "21.2.0-next.0",
36
+ version: "21.2.0-next.2",
37
37
  ngImport: i0,
38
38
  type: RouterTestingModule,
39
39
  deps: [],
@@ -41,14 +41,14 @@ class RouterTestingModule {
41
41
  });
42
42
  static ɵmod = i0.ɵɵngDeclareNgModule({
43
43
  minVersion: "14.0.0",
44
- version: "21.2.0-next.0",
44
+ version: "21.2.0-next.2",
45
45
  ngImport: i0,
46
46
  type: RouterTestingModule,
47
47
  exports: [RouterModule]
48
48
  });
49
49
  static ɵinj = i0.ɵɵngDeclareInjector({
50
50
  minVersion: "12.0.0",
51
- version: "21.2.0-next.0",
51
+ version: "21.2.0-next.2",
52
52
  ngImport: i0,
53
53
  type: RouterTestingModule,
54
54
  providers: [ROUTER_PROVIDERS, provideLocationMocks(), withPreloading(NoPreloading).ɵproviders, {
@@ -61,7 +61,7 @@ class RouterTestingModule {
61
61
  }
62
62
  i0.ɵɵngDeclareClassMetadata({
63
63
  minVersion: "12.0.0",
64
- version: "21.2.0-next.0",
64
+ version: "21.2.0-next.2",
65
65
  ngImport: i0,
66
66
  type: RouterTestingModule,
67
67
  decorators: [{
@@ -97,7 +97,7 @@ class RootFixtureService {
97
97
  }
98
98
  static ɵfac = i0.ɵɵngDeclareFactory({
99
99
  minVersion: "12.0.0",
100
- version: "21.2.0-next.0",
100
+ version: "21.2.0-next.2",
101
101
  ngImport: i0,
102
102
  type: RootFixtureService,
103
103
  deps: [],
@@ -105,7 +105,7 @@ class RootFixtureService {
105
105
  });
106
106
  static ɵprov = i0.ɵɵngDeclareInjectable({
107
107
  minVersion: "12.0.0",
108
- version: "21.2.0-next.0",
108
+ version: "21.2.0-next.2",
109
109
  ngImport: i0,
110
110
  type: RootFixtureService,
111
111
  providedIn: 'root'
@@ -113,7 +113,7 @@ class RootFixtureService {
113
113
  }
114
114
  i0.ɵɵngDeclareClassMetadata({
115
115
  minVersion: "12.0.0",
116
- version: "21.2.0-next.0",
116
+ version: "21.2.0-next.2",
117
117
  ngImport: i0,
118
118
  type: RootFixtureService,
119
119
  decorators: [{
@@ -130,7 +130,7 @@ class RootCmp {
130
130
  }] : []));
131
131
  static ɵfac = i0.ɵɵngDeclareFactory({
132
132
  minVersion: "12.0.0",
133
- version: "21.2.0-next.0",
133
+ version: "21.2.0-next.2",
134
134
  ngImport: i0,
135
135
  type: RootCmp,
136
136
  deps: [],
@@ -138,7 +138,7 @@ class RootCmp {
138
138
  });
139
139
  static ɵcmp = i0.ɵɵngDeclareComponent({
140
140
  minVersion: "14.0.0",
141
- version: "21.2.0-next.0",
141
+ version: "21.2.0-next.2",
142
142
  type: RootCmp,
143
143
  isStandalone: true,
144
144
  selector: "ng-component",
@@ -163,7 +163,7 @@ class RootCmp {
163
163
  }
164
164
  i0.ɵɵngDeclareClassMetadata({
165
165
  minVersion: "12.0.0",
166
- version: "21.2.0-next.0",
166
+ version: "21.2.0-next.2",
167
167
  ngImport: i0,
168
168
  type: RootCmp,
169
169
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/testing/src/router_testing_module.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/testing/src/router_testing_harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {provideLocationMocks} from '@angular/common/testing';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {\n ExtraOptions,\n NoPreloading,\n ROUTER_CONFIGURATION,\n RouterModule,\n ROUTES,\n Routes,\n withPreloading,\n ɵROUTER_PROVIDERS as ROUTER_PROVIDERS,\n} from '../../index';\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location` and `LocationStrategy`.\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * beforeEach(() => {\n * TestBed.configureTestingModule({\n * imports: [\n * RouterModule.forRoot(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n * @deprecated Use `provideRouter` or `RouterModule`/`RouterModule.forRoot` instead.\n * This module was previously used to provide a helpful collection of test fakes,\n * most notably those for `Location` and `LocationStrategy`. These are generally not\n * required anymore, as `MockPlatformLocation` is provided in `TestBed` by default.\n * However, you can use them directly with `provideLocationMocks`.\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS,\n provideLocationMocks(),\n withPreloading(NoPreloading).ɵproviders,\n {provide: ROUTES, multi: true, useValue: []},\n ],\n})\nexport class RouterTestingModule {\n static withRoutes(\n routes: Routes,\n config?: ExtraOptions,\n ): ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n {provide: ROUTES, multi: true, useValue: routes},\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ],\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Component,\n DebugElement,\n Injectable,\n Type,\n ViewChild,\n WritableSignal,\n signal,\n} from '@angular/core';\nimport {ComponentFixture, TestBed} from '@angular/core/testing';\nimport {Router, RouterOutlet, ɵafterNextNavigation as afterNextNavigation} from '../../index';\n\n@Injectable({providedIn: 'root'})\nexport class RootFixtureService {\n private fixture?: ComponentFixture<RootCmp>;\n private harness?: RouterTestingHarness;\n\n createHarness(): RouterTestingHarness {\n if (this.harness) {\n throw new Error('Only one harness should be created per test.');\n }\n this.harness = new RouterTestingHarness(this.getRootFixture());\n return this.harness;\n }\n\n private getRootFixture(): ComponentFixture<RootCmp> {\n if (this.fixture !== undefined) {\n return this.fixture;\n }\n this.fixture = TestBed.createComponent(RootCmp);\n this.fixture.detectChanges();\n return this.fixture;\n }\n}\n\n@Component({\n template: '<router-outlet [routerOutletData]=\"routerOutletData()\"></router-outlet>',\n imports: [RouterOutlet],\n})\nexport class RootCmp {\n @ViewChild(RouterOutlet) outlet?: RouterOutlet;\n readonly routerOutletData = signal<unknown>(undefined);\n}\n\n/**\n * A testing harness for the `Router` to reduce the boilerplate needed to test routes and routed\n * components.\n *\n * @publicApi\n */\nexport class RouterTestingHarness {\n /**\n * Creates a `RouterTestingHarness` instance.\n *\n * The `RouterTestingHarness` also creates its own root component with a `RouterOutlet` for the\n * purposes of rendering route components.\n *\n * Throws an error if an instance has already been created.\n * Use of this harness also requires `destroyAfterEach: true` in the `ModuleTeardownOptions`\n *\n * @param initialUrl The target of navigation to trigger before returning the harness.\n */\n static async create(initialUrl?: string): Promise<RouterTestingHarness> {\n const harness = TestBed.inject(RootFixtureService).createHarness();\n if (initialUrl !== undefined) {\n await harness.navigateByUrl(initialUrl);\n }\n return harness;\n }\n\n /**\n * Fixture of the root component of the RouterTestingHarness\n */\n public readonly fixture: ComponentFixture<{routerOutletData: WritableSignal<unknown>}>;\n\n /** @internal */\n constructor(fixture: ComponentFixture<{routerOutletData: WritableSignal<unknown>}>) {\n this.fixture = fixture;\n }\n\n /** Instructs the root fixture to run change detection. */\n detectChanges(): void {\n this.fixture.detectChanges();\n }\n /** The `DebugElement` of the `RouterOutlet` component. `null` if the outlet is not activated. */\n get routeDebugElement(): DebugElement | null {\n const outlet = (this.fixture.componentInstance as RootCmp).outlet;\n if (!outlet || !outlet.isActivated) {\n return null;\n }\n return this.fixture.debugElement.query((v) => v.componentInstance === outlet.component);\n }\n /** The native element of the `RouterOutlet` component. `null` if the outlet is not activated. */\n get routeNativeElement(): HTMLElement | null {\n return this.routeDebugElement?.nativeElement ?? null;\n }\n\n /**\n * Triggers a `Router` navigation and waits for it to complete.\n *\n * The root component with a `RouterOutlet` created for the harness is used to render `Route`\n * components. The root component is reused within the same test in subsequent calls to\n * `navigateForTest`.\n *\n * When testing `Routes` with a guards that reject the navigation, the `RouterOutlet` might not be\n * activated and the `activatedComponent` may be `null`.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='Guard'}\n *\n * @param url The target of the navigation. Passed to `Router.navigateByUrl`.\n * @returns The activated component instance of the `RouterOutlet` after navigation completes\n * (`null` if the outlet does not get activated).\n */\n async navigateByUrl(url: string): Promise<null | {}>;\n /**\n * Triggers a router navigation and waits for it to complete.\n *\n * The root component with a `RouterOutlet` created for the harness is used to render `Route`\n * components.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='RoutedComponent'}\n *\n * The root component is reused within the same test in subsequent calls to `navigateByUrl`.\n *\n * This function also makes it easier to test components that depend on `ActivatedRoute` data.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='ActivatedRoute'}\n *\n * @param url The target of the navigation. Passed to `Router.navigateByUrl`.\n * @param requiredRoutedComponentType After navigation completes, the required type for the\n * activated component of the `RouterOutlet`. If the outlet is not activated or a different\n * component is activated, this function will throw an error.\n * @returns The activated component instance of the `RouterOutlet` after navigation completes.\n */\n async navigateByUrl<T>(url: string, requiredRoutedComponentType: Type<T>): Promise<T>;\n async navigateByUrl<T>(url: string, requiredRoutedComponentType?: Type<T>): Promise<T | null> {\n const router = TestBed.inject(Router);\n let resolveFn!: () => void;\n const redirectTrackingPromise = new Promise<void>((resolve) => {\n resolveFn = resolve;\n });\n afterNextNavigation(TestBed.inject(Router), resolveFn);\n await router.navigateByUrl(url);\n await redirectTrackingPromise;\n this.fixture.detectChanges();\n const outlet = (this.fixture.componentInstance as RootCmp).outlet;\n // The outlet might not be activated if the user is testing a navigation for a guard that\n // rejects\n if (outlet && outlet.isActivated && outlet.activatedRoute.component) {\n const activatedComponent = outlet.component;\n if (\n requiredRoutedComponentType !== undefined &&\n !(activatedComponent instanceof requiredRoutedComponentType)\n ) {\n throw new Error(\n `Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but got ${activatedComponent.constructor.name}`,\n );\n }\n return activatedComponent as T;\n } else {\n if (requiredRoutedComponentType !== undefined) {\n throw new Error(\n `Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but the navigation did not activate any component.`,\n );\n }\n return null;\n }\n }\n}\n"],"names":["RouterTestingModule","withRoutes","routes","config","ngModule","providers","provide","ROUTES","multi","useValue","ROUTER_CONFIGURATION","deps","target","i0","ɵɵFactoryTarget","NgModule","ɵmod","ɵɵngDeclareNgModule","minVersion","version","ngImport","type","RouterModule","ɵinj","ɵɵngDeclareInjector","ROUTER_PROVIDERS","provideLocationMocks","withPreloading","NoPreloading","ɵproviders","imports","decorators","args","exports","RootFixtureService","fixture","harness","createHarness","Error","RouterTestingHarness","getRootFixture","undefined","TestBed","createComponent","RootCmp","detectChanges","Injectable","ɵprov","ɵɵngDeclareInjectable","providedIn","outlet","routerOutletData","signal","Component","ɵcmp","ɵɵngDeclareComponent","isStandalone","selector","viewQueries","propertyName","first","predicate","RouterOutlet","descendants","template","inputs","outputs","exportAs","ViewChild","create","initialUrl","inject","navigateByUrl","constructor","routeDebugElement","componentInstance","isActivated","debugElement","query","v","component","routeNativeElement","nativeElement","url","requiredRoutedComponentType","router","Router","resolveFn","redirectTrackingPromise","Promise","resolve","afterNextNavigation","activatedRoute","activatedComponent","name"],"mappings":";;;;;;;;;;;;;;;;;;;MA4DaA,mBAAmB,CAAA;AAC9B,EAAA,OAAOC,UAAUA,CACfC,MAAc,EACdC,MAAqB,EAAA;IAErB,OAAO;AACLC,MAAAA,QAAQ,EAAEJ,mBAAmB;AAC7BK,MAAAA,SAAS,EAAE,CACT;AAACC,QAAAA,OAAO,EAAEC,MAAM;AAAEC,QAAAA,KAAK,EAAE,IAAI;AAAEC,QAAAA,QAAQ,EAAEP;AAAO,OAAA,EAChD;AAACI,QAAAA,OAAO,EAAEI,oBAAoB;AAAED,QAAAA,QAAQ,EAAEN,MAAM,GAAGA,MAAM,GAAG;OAAG;KAElE;AACH;;;;;UAZWH,mBAAmB;AAAAW,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;AAAnB,EAAA,OAAAC,IAAA,GAAAH,EAAA,CAAAI,mBAAA,CAAA;AAAAC,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAP,EAAA;AAAAQ,IAAAA,IAAA,EAAArB,mBAAmB;cARpBsB,YAAY;AAAA,GAAA,CAAA;AAQX,EAAA,OAAAC,IAAA,GAAAV,EAAA,CAAAW,mBAAA,CAAA;AAAAN,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,mBAAA;AAAAC,IAAAA,QAAA,EAAAP,EAAA;AAAAQ,IAAAA,IAAA,EAAArB,mBAAmB;AAPnBK,IAAAA,SAAA,EAAA,CACToB,gBAAgB,EAChBC,oBAAoB,EAAE,EACtBC,cAAc,CAACC,YAAY,CAAC,CAACC,UAAU,EACvC;A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AAC6B,MAAM,CAACe,MAAM,CAAC;AACrC,IAAA,IAAIC,SAAsB;AAC1B,IAAA,MAAMC,uBAAuB,GAAG,IAAIC,OAAO,CAAQC,OAAO,IAAI;AAC5DH,MAAAA,SAAS,GAAGG,OAAO;AACrB,KAAC,CAAC;IACFC,mBAAmB,CAACjD,OAAO,CAAC6B,MAAM,CAACe,MAAM,CAAC,EAAEC,SAAS,CAAC;AACtD,IAAA,MAAMF,MAAM,CAACb,aAAa,CAACW,GAAG,CAAC;AAC/B,IAAA,MAAMK,uBAAuB;AAC7B,IAAA,IAAI,CAACrD,OAAO,CAACU,aAAa,EAAE;IAC5B,MAAMK,MAAM,GAAI,IAAI,CAACf,OAAO,CAACwC,iBAA6B,CAACzB,MAAM;IAGjE,IAAIA,MAAM,IAAIA,MAAM,CAAC0B,WAAW,IAAI1B,MAAM,CAAC0C,cAAc,CAACZ,SAAS,EAAE;AACnE,MAAA,MAAMa,kBAAkB,GAAG3C,MAAM,CAAC8B,SAAS;MAC3C,IACEI,2BAA2B,KAAK3C,SAAS,IACzC,EAAEoD,kBAAkB,YAAYT,2BAA2B,CAAC,EAC5D;AACA,QAAA,MAAM,IAAI9C,KAAK,CACb,CAAA,2CAAA,EAA8C8C,2BAA2B,CAACU,IAAI,CAAYD,SAAAA,EAAAA,kBAAkB,CAACpB,WAAW,CAACqB,IAAI,EAAE,CAChI;AACH;AACA,MAAA,OAAOD,kBAAuB;AAChC,KAAA,MAAO;MACL,IAAIT,2BAA2B,KAAK3C,SAAS,EAAE;QAC7C,MAAM,IAAIH,KAAK,CACb,CAAA,2CAAA,EAA8C8C,2BAA2B,CAACU,IAAI,qDAAqD,CACpI;AACH;AACA,MAAA,OAAO,IAAI;AACb;AACF;AACD;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/testing/src/router_testing_module.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/testing/src/router_testing_harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {provideLocationMocks} from '@angular/common/testing';\nimport {ModuleWithProviders, NgModule} from '@angular/core';\nimport {\n ExtraOptions,\n NoPreloading,\n ROUTER_CONFIGURATION,\n RouterModule,\n ROUTES,\n Routes,\n withPreloading,\n ɵROUTER_PROVIDERS as ROUTER_PROVIDERS,\n} from '../../index';\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location` and `LocationStrategy`.\n *\n * @usageNotes\n * ### Example\n *\n * ```ts\n * beforeEach(() => {\n * TestBed.configureTestingModule({\n * imports: [\n * RouterModule.forRoot(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n * @deprecated Use `provideRouter` or `RouterModule`/`RouterModule.forRoot` instead.\n * This module was previously used to provide a helpful collection of test fakes,\n * most notably those for `Location` and `LocationStrategy`. These are generally not\n * required anymore, as `MockPlatformLocation` is provided in `TestBed` by default.\n * However, you can use them directly with `provideLocationMocks`.\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS,\n provideLocationMocks(),\n withPreloading(NoPreloading).ɵproviders,\n {provide: ROUTES, multi: true, useValue: []},\n ],\n})\nexport class RouterTestingModule {\n static withRoutes(\n routes: Routes,\n config?: ExtraOptions,\n ): ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n {provide: ROUTES, multi: true, useValue: routes},\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ],\n };\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Component,\n DebugElement,\n Injectable,\n Type,\n ViewChild,\n WritableSignal,\n signal,\n} from '@angular/core';\nimport {ComponentFixture, TestBed} from '@angular/core/testing';\nimport {Router, RouterOutlet, ɵafterNextNavigation as afterNextNavigation} from '../../index';\n\n@Injectable({providedIn: 'root'})\nexport class RootFixtureService {\n private fixture?: ComponentFixture<RootCmp>;\n private harness?: RouterTestingHarness;\n\n createHarness(): RouterTestingHarness {\n if (this.harness) {\n throw new Error('Only one harness should be created per test.');\n }\n this.harness = new RouterTestingHarness(this.getRootFixture());\n return this.harness;\n }\n\n private getRootFixture(): ComponentFixture<RootCmp> {\n if (this.fixture !== undefined) {\n return this.fixture;\n }\n this.fixture = TestBed.createComponent(RootCmp);\n this.fixture.detectChanges();\n return this.fixture;\n }\n}\n\n@Component({\n template: '<router-outlet [routerOutletData]=\"routerOutletData()\"></router-outlet>',\n imports: [RouterOutlet],\n})\nexport class RootCmp {\n @ViewChild(RouterOutlet) outlet?: RouterOutlet;\n readonly routerOutletData = signal<unknown>(undefined);\n}\n\n/**\n * A testing harness for the `Router` to reduce the boilerplate needed to test routes and routed\n * components.\n *\n * @publicApi\n */\nexport class RouterTestingHarness {\n /**\n * Creates a `RouterTestingHarness` instance.\n *\n * The `RouterTestingHarness` also creates its own root component with a `RouterOutlet` for the\n * purposes of rendering route components.\n *\n * Throws an error if an instance has already been created.\n * Use of this harness also requires `destroyAfterEach: true` in the `ModuleTeardownOptions`\n *\n * @param initialUrl The target of navigation to trigger before returning the harness.\n */\n static async create(initialUrl?: string): Promise<RouterTestingHarness> {\n const harness = TestBed.inject(RootFixtureService).createHarness();\n if (initialUrl !== undefined) {\n await harness.navigateByUrl(initialUrl);\n }\n return harness;\n }\n\n /**\n * Fixture of the root component of the RouterTestingHarness\n */\n public readonly fixture: ComponentFixture<{routerOutletData: WritableSignal<unknown>}>;\n\n /** @internal */\n constructor(fixture: ComponentFixture<{routerOutletData: WritableSignal<unknown>}>) {\n this.fixture = fixture;\n }\n\n /** Instructs the root fixture to run change detection. */\n detectChanges(): void {\n this.fixture.detectChanges();\n }\n /** The `DebugElement` of the `RouterOutlet` component. `null` if the outlet is not activated. */\n get routeDebugElement(): DebugElement | null {\n const outlet = (this.fixture.componentInstance as RootCmp).outlet;\n if (!outlet || !outlet.isActivated) {\n return null;\n }\n return this.fixture.debugElement.query((v) => v.componentInstance === outlet.component);\n }\n /** The native element of the `RouterOutlet` component. `null` if the outlet is not activated. */\n get routeNativeElement(): HTMLElement | null {\n return this.routeDebugElement?.nativeElement ?? null;\n }\n\n /**\n * Triggers a `Router` navigation and waits for it to complete.\n *\n * The root component with a `RouterOutlet` created for the harness is used to render `Route`\n * components. The root component is reused within the same test in subsequent calls to\n * `navigateForTest`.\n *\n * When testing `Routes` with a guards that reject the navigation, the `RouterOutlet` might not be\n * activated and the `activatedComponent` may be `null`.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='Guard'}\n *\n * @param url The target of the navigation. Passed to `Router.navigateByUrl`.\n * @returns The activated component instance of the `RouterOutlet` after navigation completes\n * (`null` if the outlet does not get activated).\n */\n async navigateByUrl(url: string): Promise<null | {}>;\n /**\n * Triggers a router navigation and waits for it to complete.\n *\n * The root component with a `RouterOutlet` created for the harness is used to render `Route`\n * components.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='RoutedComponent'}\n *\n * The root component is reused within the same test in subsequent calls to `navigateByUrl`.\n *\n * This function also makes it easier to test components that depend on `ActivatedRoute` data.\n *\n * {@example router/testing/test/router_testing_harness_examples.spec.ts region='ActivatedRoute'}\n *\n * @param url The target of the navigation. Passed to `Router.navigateByUrl`.\n * @param requiredRoutedComponentType After navigation completes, the required type for the\n * activated component of the `RouterOutlet`. If the outlet is not activated or a different\n * component is activated, this function will throw an error.\n * @returns The activated component instance of the `RouterOutlet` after navigation completes.\n */\n async navigateByUrl<T>(url: string, requiredRoutedComponentType: Type<T>): Promise<T>;\n async navigateByUrl<T>(url: string, requiredRoutedComponentType?: Type<T>): Promise<T | null> {\n const router = TestBed.inject(Router);\n let resolveFn!: () => void;\n const redirectTrackingPromise = new Promise<void>((resolve) => {\n resolveFn = resolve;\n });\n afterNextNavigation(TestBed.inject(Router), resolveFn);\n await router.navigateByUrl(url);\n await redirectTrackingPromise;\n this.fixture.detectChanges();\n const outlet = (this.fixture.componentInstance as RootCmp).outlet;\n // The outlet might not be activated if the user is testing a navigation for a guard that\n // rejects\n if (outlet && outlet.isActivated && outlet.activatedRoute.component) {\n const activatedComponent = outlet.component;\n if (\n requiredRoutedComponentType !== undefined &&\n !(activatedComponent instanceof requiredRoutedComponentType)\n ) {\n throw new Error(\n `Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but got ${activatedComponent.constructor.name}`,\n );\n }\n return activatedComponent as T;\n } else {\n if (requiredRoutedComponentType !== undefined) {\n throw new Error(\n `Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but the navigation did not activate any component.`,\n );\n }\n return null;\n }\n }\n}\n"],"names":["RouterTestingModule","withRoutes","routes","config","ngModule","providers","provide","ROUTES","multi","useValue","ROUTER_CONFIGURATION","deps","target","i0","ɵɵFactoryTarget","NgModule","ɵmod","ɵɵngDeclareNgModule","minVersion","version","ngImport","type","RouterModule","ɵinj","ɵɵngDeclareInjector","ROUTER_PROVIDERS","provideLocationMocks","withPreloading","NoPreloading","ɵproviders","imports","decorators","args","exports","RootFixtureService","fixture","harness","createHarness","Error","RouterTestingHarness","getRootFixture","undefined","TestBed","createComponent","RootCmp","detectChanges","Injectable","ɵprov","ɵɵngDeclareInjectable","providedIn","outlet","routerOutletData","signal","Component","ɵcmp","ɵɵngDeclareComponent","isStandalone","selector","viewQueries","propertyName","first","predicate","RouterOutlet","descendants","template","inputs","outputs","exportAs","ViewChild","create","initialUrl","inject","navigateByUrl","constructor","routeDebugElement","componentInstance","isActivated","debugElement","query","v","component","routeNativeElement","nativeElement","url","requiredRoutedComponentType","router","Router","resolveFn","redirectTrackingPromise","Promise","resolve","afterNextNavigation","activatedRoute","activatedComponent","name"],"mappings":";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,KAAC,CAAC;IACFC,mBAAmB,CAACjD,OAAO,CAAC6B,MAAM,CAACe,MAAM,CAAC,EAAEC,SAAS,CAAC;AACtD,IAAA,MAAMF,MAAM,CAACb,aAAa,CAACW,GAAG,CAAC;AAC/B,IAAA,MAAMK,uBAAuB;AAC7B,IAAA,IAAI,CAACrD,OAAO,CAACU,aAAa,EAAE;IAC5B,MAAMK,MAAM,GAAI,IAAI,CAACf,OAAO,CAACwC,iBAA6B,CAACzB,MAAM;IAGjE,IAAIA,MAAM,IAAIA,MAAM,CAAC0B,WAAW,IAAI1B,MAAM,CAAC0C,cAAc,CAACZ,SAAS,EAAE;AACnE,MAAA,MAAMa,kBAAkB,GAAG3C,MAAM,CAAC8B,SAAS;MAC3C,IACEI,2BAA2B,KAAK3C,SAAS,IACzC,EAAEoD,kBAAkB,YAAYT,2BAA2B,CAAC,EAC5D;AACA,QAAA,MAAM,IAAI9C,KAAK,CACb,CAAA,2CAAA,EAA8C8C,2BAA2B,CAACU,IAAI,CAAYD,SAAAA,EAAAA,kBAAkB,CAACpB,WAAW,CAACqB,IAAI,EAAE,CAChI;AACH;AACA,MAAA,OAAOD,kBAAuB;AAChC,KAAA,MAAO;MACL,IAAIT,2BAA2B,KAAK3C,SAAS,EAAE;QAC7C,MAAM,IAAIH,KAAK,CACb,CAAA,2CAAA,EAA8C8C,2BAA2B,CAACU,IAAI,qDAAqD,CACpI;AACH;AACA,MAAA,OAAO,IAAI;AACb;AACF;AACD;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/router/upgrade/src/upgrade.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {APP_BOOTSTRAP_LISTENER, ComponentRef, inject} from '@angular/core';\nimport {Router, ɵRestoredState as RestoredState} from '../../index';\nimport {UpgradeModule} from '@angular/upgrade/static';\n\n/**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * For standalone applications:\n * ```ts\n * export const appConfig: ApplicationConfig = {\n * providers: [RouterUpgradeInitializer],\n * };\n * ```\n *\n * For NgModule based applications:\n * ```ts\n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * ```\n *\n * @publicApi\n */\nexport const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as () => () => void,\n};\n\n/**\n * @internal\n */\nexport function locationSyncBootstrapListener() {\n const ngUpgrade = inject(UpgradeModule);\n\n return () => {\n setUpLocationSync(ngUpgrade);\n };\n}\n\n/**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see {@link /api/common/HashLocationStrategy HashLocationStrategy}\n * @see {@link /api/common/PathLocationStrategy PathLocationStrategy}\n *\n * @publicApi\n */\nexport function setUpLocationSync(\n ngUpgrade: UpgradeModule,\n urlType: 'path' | 'hash' = 'path',\n): void {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n\n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n\n ngUpgrade.$injector\n .get('$rootScope')\n .$on(\n '$locationChangeStart',\n (\n event: any,\n newUrl: string,\n oldUrl: string,\n newState?: {[k: string]: unknown} | RestoredState,\n oldState?: {[k: string]: unknown} | RestoredState,\n ) => {\n // Navigations coming from Angular router have a navigationId state\n // property. Don't trigger Angular router navigation again if it is\n // caused by a URL change from the current Angular router\n // navigation.\n const currentNavigationId = router.getCurrentNavigation()?.id;\n const newStateNavigationId = newState?.navigationId;\n if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {\n return;\n }\n\n let url;\n if (urlType === 'path') {\n url = resolveUrl(newUrl);\n } else if (urlType === 'hash') {\n // Remove the first hash from the URL\n const hashIdx = newUrl.indexOf('#');\n url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));\n } else {\n throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;\n }\n const path = location.normalize(url.pathname);\n router.navigateByUrl(path + url.search + url.hash);\n },\n );\n}\n\n/**\n * Normalizes and parses a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\nlet anchor: HTMLAnchorElement | undefined;\nfunction resolveUrl(url: string): {pathname: string; search: string; hash: string} {\n anchor ??= document.createElement('a');\n\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n\n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash,\n };\n}\n"],"names":["RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","locationSyncBootstrapListener","ngUpgrade","inject","UpgradeModule","setUpLocationSync","urlType","$injector","Error","router","injector","get","Router","location","Location","$on","event","newUrl","oldUrl","newState","oldState","currentNavigationId","getCurrentNavigation","id","newStateNavigationId","navigationId","undefined","url","resolveUrl","hashIdx","indexOf","substring","path","normalize","pathname","navigateByUrl","search","hash","anchor","document","createElement","setAttribute","href","replace"],"mappings":";;;;;;;;;;;;;;AA4CO,MAAMA,wBAAwB,GAAG;AACtCC,EAAAA,OAAO,EAAEC,sBAAsB;AAC/BC,EAAAA,KAAK,EAAE,IAAI;AACXC,EAAAA,UAAU,EAAEC;;SAMEA,6BAA6BA,GAAA;AAC3C,EAAA,MAAMC,SAAS,GAAGC,MAAM,CAACC,aAAa,CAAC;AAEvC,EAAA,OAAO,MAAK;IACVC,iBAAiB,CAACH,SAAS,CAAC;GAC7B;AACH;SAcgBG,iBAAiBA,CAC/BH,SAAwB,EACxBI,UAA2B,MAAM,EAAA;AAEjC,EAAA,IAAI,CAACJ,SAAS,CAACK,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CAAC;;;AAGb,MAAA,CAAA,CAAC;AACN;EAEA,MAAMC,MAAM,GAAWP,SAAS,CAACQ,QAAQ,CAACC,GAAG,CAACC,MAAM,CAAC;EACrD,MAAMC,QAAQ,GAAaX,SAAS,CAACQ,QAAQ,CAACC,GAAG,CAACG,QAAQ,CAAC;EAE3DZ,SAAS,CAACK,SAAS,CAChBI,GAAG,CAAC,YAAY,CAAA,CAChBI,GAAG,CACF,sBAAsB,EACtB,CACEC,KAAU,EACVC,MAAc,EACdC,MAAc,EACdC,QAAiD,EACjDC,QAAiD,KAC/C;IAKF,MAAMC,mBAAmB,GAAGZ,MAAM,CAACa,oBAAoB,EAAE,EAAEC,EAAE;AAC7D,IAAA,MAA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AM,CAACD;GACd;AACH;;;;"}
1
+ {"version":3,"file":"upgrade.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/router/upgrade/src/upgrade.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {APP_BOOTSTRAP_LISTENER, ComponentRef, inject} from '@angular/core';\nimport {Router, ɵRestoredState as RestoredState} from '../../index';\nimport {UpgradeModule} from '@angular/upgrade/static';\n\n/**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * For standalone applications:\n * ```ts\n * export const appConfig: ApplicationConfig = {\n * providers: [RouterUpgradeInitializer],\n * };\n * ```\n *\n * For NgModule based applications:\n * ```ts\n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * ```\n *\n * @publicApi\n */\nexport const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as () => () => void,\n};\n\n/**\n * @internal\n */\nexport function locationSyncBootstrapListener() {\n const ngUpgrade = inject(UpgradeModule);\n\n return () => {\n setUpLocationSync(ngUpgrade);\n };\n}\n\n/**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see {@link /api/common/HashLocationStrategy HashLocationStrategy}\n * @see {@link /api/common/PathLocationStrategy PathLocationStrategy}\n *\n * @publicApi\n */\nexport function setUpLocationSync(\n ngUpgrade: UpgradeModule,\n urlType: 'path' | 'hash' = 'path',\n): void {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n\n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n\n ngUpgrade.$injector\n .get('$rootScope')\n .$on(\n '$locationChangeStart',\n (\n event: any,\n newUrl: string,\n oldUrl: string,\n newState?: {[k: string]: unknown} | RestoredState,\n oldState?: {[k: string]: unknown} | RestoredState,\n ) => {\n // Navigations coming from Angular router have a navigationId state\n // property. Don't trigger Angular router navigation again if it is\n // caused by a URL change from the current Angular router\n // navigation.\n const currentNavigationId = router.getCurrentNavigation()?.id;\n const newStateNavigationId = newState?.navigationId;\n if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {\n return;\n }\n\n let url;\n if (urlType === 'path') {\n url = resolveUrl(newUrl);\n } else if (urlType === 'hash') {\n // Remove the first hash from the URL\n const hashIdx = newUrl.indexOf('#');\n url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));\n } else {\n throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;\n }\n const path = location.normalize(url.pathname);\n router.navigateByUrl(path + url.search + url.hash);\n },\n );\n}\n\n/**\n * Normalizes and parses a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\nlet anchor: HTMLAnchorElement | undefined;\nfunction resolveUrl(url: string): {pathname: string; search: string; hash: string} {\n anchor ??= document.createElement('a');\n\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n\n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash,\n };\n}\n"],"names":["RouterUpgradeInitializer","provide","APP_BOOTSTRAP_LISTENER","multi","useFactory","locationSyncBootstrapListener","ngUpgrade","inject","UpgradeModule","setUpLocationSync","urlType","$injector","Error","router","injector","get","Router","location","Location","$on","event","newUrl","oldUrl","newState","oldState","currentNavigationId","getCurrentNavigation","id","newStateNavigationId","navigationId","undefined","url","resolveUrl","hashIdx","indexOf","substring","path","normalize","pathname","navigateByUrl","search","hash","anchor","document","createElement","setAttribute","href","replace"],"mappings":";;;;;;;;;;;;;;AA4CO,MAAMA,wBAAwB,GAAG;AACtCC,EAAAA,OAAO,EAAEC,sBAAsB;AAC/BC,EAAAA,KAAK,EAAE,IAAI;AACXC,EAAAA,UAAU,EAAEC;;SAMEA,6BAA6BA,GAAA;AAC3C,EAAA,MAAMC,SAAS,GAAGC,MAAM,CAACC,aAAa,CAAC;AAEvC,EAAA,OAAO,MAAK;IACVC,iBAAiB,CAACH,SAAS,CAAC;GAC7B;AACH;SAcgBG,iBAAiBA,CAC/BH,SAAwB,EACxBI,UAA2B,MAAM,EAAA;AAEjC,EAAA,IAAI,CAACJ,SAAS,CAACK,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CAAC;;;AAGb,MAAA,CAAA,CAAC;AACN;EAEA,MAAMC,MAAM,GAAWP,SAAS,CAACQ,QAAQ,CAACC,GAAG,CAACC,MAAM,CAAC;EACrD,MAAMC,QAAQ,GAAaX,SAAS,CAACQ,QAAQ,CAACC,GAAG,CAACG,QAAQ,CAAC;EAE3DZ,SAAS,CAACK,SAAS,CAChBI,GAAG,CAAC,YAAY,C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C;EAExC,OAAO;AAELR,IAAAA,QAAQ,EAAE,CAAA,CAAA,EAAII,MAAM,CAACJ,QAAQ,CAACS,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAE,CAAA;IAClDP,MAAM,EAAEE,MAAM,CAACF,MAAM;IACrBC,IAAI,EAAEC,MAAM,CAACD;GACd;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "21.2.0-next.0",
3
+ "version": "21.2.0-next.2",
4
4
  "description": "Angular - the routing library",
5
5
  "keywords": [
6
6
  "angular",
@@ -27,9 +27,9 @@
27
27
  "@types/dom-navigation": "^1.0.5"
28
28
  },
29
29
  "peerDependencies": {
30
- "@angular/core": "21.2.0-next.0",
31
- "@angular/common": "21.2.0-next.0",
32
- "@angular/platform-browser": "21.2.0-next.0",
30
+ "@angular/core": "21.2.0-next.2",
31
+ "@angular/common": "21.2.0-next.2",
32
+ "@angular/platform-browser": "21.2.0-next.2",
33
33
  "rxjs": "^6.5.3 || ^7.4.0"
34
34
  },
35
35
  "ng-update": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1446,11 +1446,10 @@ declare class Router {
1446
1446
  */
1447
1447
  isActive(url: string | UrlTree, exact: boolean): boolean;
1448
1448
  /**
1449
- * Returns whether the url is activated.
1450
- * @deprecated 21.1 - Use the `isActive` function instead.
1451
1449
  * @see {@link isActive}
1450
+ * @deprecated 21.1 - Use the `isActive` function instead.
1452
1451
  */
1453
- isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
1452
+ isActive(url: string | UrlTree, matchOptions: Partial<IsActiveMatchOptions>): boolean;
1454
1453
  private removeEmptyProps;
1455
1454
  private scheduleNavigation;
1456
1455
  static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
@@ -1509,10 +1508,16 @@ interface IsActiveMatchOptions {
1509
1508
  *
1510
1509
  * As the router state changes, the signal will update to reflect whether the url is active.
1511
1510
  *
1511
+ * When using the `matchOptions` argument, any missing properties fall back to the following defaults:
1512
+ * - `paths`: 'subset'
1513
+ * - `queryParams`: 'subset'
1514
+ * - `matrixParams`: 'ignored'
1515
+ * - `fragment`: 'ignored'
1516
+ *
1512
1517
  * @see [Check if a URL is active](guide/routing/read-route-state#check-if-a-url-is-active)
1513
1518
  * @publicApi 21.1
1514
1519
  */
1515
- declare function isActive(url: string | UrlTree, router: Router, matchOptions: IsActiveMatchOptions): Signal<boolean>;
1520
+ declare function isActive(url: string | UrlTree, router: Router, matchOptions?: Partial<IsActiveMatchOptions>): Signal<boolean>;
1516
1521
  /**
1517
1522
  * @description
1518
1523
  *
@@ -1938,19 +1943,15 @@ type QueryParamsHandling = 'merge' | 'preserve' | 'replace' | '';
1938
1943
  /**
1939
1944
  * The type for the function that can be used to handle redirects when the path matches a `Route` config.
1940
1945
  *
1941
- * The `RedirectFunction` does _not_ have access to the full
1942
- * `ActivatedRouteSnapshot` interface. Some data are not accurately known
1943
- * at the route matching phase. For example, resolvers are not run until
1944
- * later, so any resolved title would not be populated. The same goes for lazy
1945
- * loaded components. This is also true for all the snapshots up to the
1946
- * root, so properties that include parents (root, parent, pathFromRoot)
1947
- * are also excluded. And naturally, the full route matching hasn't yet
1948
- * happened so firstChild and children are not available either.
1946
+ * The `RedirectFunction` does not have access to the full
1947
+ * `ActivatedRouteSnapshot` interface because Route matching has not
1948
+ * yet completed when the function is called. See {@link PartialMatchRouteSnapshot}
1949
+ * for more information.
1949
1950
  *
1950
1951
  * @see {@link Route#redirectTo}
1951
1952
  * @publicApi
1952
1953
  */
1953
- type RedirectFunction = (redirectData: Pick<ActivatedRouteSnapshot, 'routeConfig' | 'url' | 'params' | 'queryParams' | 'fragment' | 'data' | 'outlet' | 'title' | 'paramMap' | 'queryParamMap'>) => MaybeAsync<string | UrlTree>;
1954
+ type RedirectFunction = (redirectData: PartialMatchRouteSnapshot) => MaybeAsync<string | UrlTree>;
1954
1955
  /**
1955
1956
  * A policy for when to run guards and resolvers on a route.
1956
1957
  *
@@ -2720,7 +2721,7 @@ type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, c
2720
2721
  * @see [CanMatch](guide/routing/route-guards#canmatch)
2721
2722
  */
2722
2723
  interface CanMatch {
2723
- canMatch(route: Route, segments: UrlSegment[]): MaybeAsync<GuardResult>;
2724
+ canMatch(route: Route, segments: UrlSegment[], currentSnapshot?: PartialMatchRouteSnapshot): MaybeAsync<GuardResult>;
2724
2725
  }
2725
2726
  /**
2726
2727
  * The signature of a function used as a `canMatch` guard on a `Route`.
@@ -2736,12 +2737,28 @@ interface CanMatch {
2736
2737
  *
2737
2738
  * @param route The route configuration.
2738
2739
  * @param segments The URL segments that have not been consumed by previous parent route evaluations.
2740
+ * @param currentSnapshot The current route snapshot up to this point in the matching process. While this parameter is optional,
2741
+ * it will always be defined when called by the Router. It is only optional for backwards compatibility with functions defined prior
2742
+ * to the introduction of this parameter.
2739
2743
  *
2740
2744
  * @publicApi
2741
2745
  * @see {@link Route}
2742
2746
  * @see [CanMatch](guide/routing/route-guards#canmatch)
2743
2747
  */
2744
- type CanMatchFn = (route: Route, segments: UrlSegment[]) => MaybeAsync<GuardResult>;
2748
+ type CanMatchFn = (route: Route, segments: UrlSegment[], currentSnapshot?: PartialMatchRouteSnapshot) => MaybeAsync<GuardResult>;
2749
+ /**
2750
+ * A subset of the `ActivatedRouteSnapshot` interface that includes only the known data
2751
+ * up to the route matching phase. Some data are not accurately known
2752
+ * at in this phase. For example, resolvers are not run until
2753
+ * later, so any resolved title would not be populated. The same goes for lazy
2754
+ * loaded components. This is also true for all the snapshots up to the
2755
+ * root, so properties that include parents (root, parent, pathFromRoot)
2756
+ * are also excluded. And naturally, the full route matching hasn't yet
2757
+ * happened so firstChild and children are not available either.
2758
+ *
2759
+ * @publicApi
2760
+ */
2761
+ type PartialMatchRouteSnapshot = Pick<ActivatedRouteSnapshot, 'routeConfig' | 'url' | 'params' | 'queryParams' | 'fragment' | 'data' | 'outlet' | 'title' | 'paramMap' | 'queryParamMap'>;
2745
2762
  /**
2746
2763
  * @description
2747
2764
  *
@@ -3719,7 +3736,7 @@ declare class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit
3719
3736
  */
3720
3737
  routerLinkActiveOptions: {
3721
3738
  exact: boolean;
3722
- } | IsActiveMatchOptions;
3739
+ } | Partial<IsActiveMatchOptions>;
3723
3740
  /**
3724
3741
  * Aria-current attribute to apply when the router link is active.
3725
3742
  *
@@ -4100,4 +4117,4 @@ declare class RouterModule {
4100
4117
  declare const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;
4101
4118
 
4102
4119
  export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, DefaultUrlSerializer, EventType, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationError, NavigationSkipped, NavigationSkippedCode, NavigationStart, PRIMARY_OUTLET, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, ROUTER_PROVIDERS, RedirectCommand, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterModule, RouterOutlet, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, convertToParamMap, defaultUrlMatcher, destroyDetachedRouteHandle, isActive, ɵEmptyOutletComponent };
4103
- export type { CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanLoad, CanLoadFn, CanMatch, CanMatchFn, Data, DefaultExport, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, Event, ExtraOptions, GuardResult, InMemoryScrollingOptions, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, LoadedRouterConfig, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationExtras, OnSameUrlNavigation, ParamMap, Params, QueryParamsHandling, RedirectFunction, Resolve, ResolveData, ResolveFn, RestoredState, Route, RouterConfigOptions, RouterOutletContract, Routes, RunGuardsAndResolvers, UrlCreationOptions, UrlMatchResult, UrlMatcher };
4120
+ export type { CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanLoad, CanLoadFn, CanMatch, CanMatchFn, Data, DefaultExport, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, Event, ExtraOptions, GuardResult, InMemoryScrollingOptions, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, LoadedRouterConfig, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationExtras, OnSameUrlNavigation, ParamMap, Params, PartialMatchRouteSnapshot, QueryParamsHandling, RedirectFunction, Resolve, ResolveData, ResolveFn, RestoredState, Route, RouterConfigOptions, RouterOutletContract, Routes, RunGuardsAndResolvers, UrlCreationOptions, UrlMatchResult, UrlMatcher };
package/types/router.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { RouterOutletContract, ActivatedRoute, ActivatedRouteSnapshot, Params, DefaultUrlSerializer, UrlTree, RouterStateSnapshot, Route, LoadedRouterConfig, Router, Routes, InMemoryScrollingOptions, RouterConfigOptions, NavigationError, RedirectCommand, CanMatch, CanMatchFn, CanActivate, CanActivateFn, CanActivateChild, CanActivateChildFn, CanDeactivate, CanDeactivateFn, Resolve, ResolveFn, Event } from './_router_module-chunk.js';
8
- export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, DefaultExport, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, EventType, ExtraOptions, GuardResult, GuardsCheckEnd, GuardsCheckStart, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationExtras, NavigationSkipped, NavigationSkippedCode, NavigationStart, OnSameUrlNavigation, PRIMARY_OUTLET, ParamMap, QueryParamsHandling, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, RedirectFunction, ResolveData, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterState, RoutesRecognized, RunGuardsAndResolvers, Scroll, UrlCreationOptions, UrlMatchResult, UrlMatcher, UrlSegment, UrlSegmentGroup, UrlSerializer, convertToParamMap, defaultUrlMatcher, destroyDetachedRouteHandle, isActive, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, RestoredState as ɵRestoredState } from './_router_module-chunk.js';
8
+ export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, DefaultExport, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, EventType, ExtraOptions, GuardResult, GuardsCheckEnd, GuardsCheckStart, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationExtras, NavigationSkipped, NavigationSkippedCode, NavigationStart, OnSameUrlNavigation, PRIMARY_OUTLET, ParamMap, PartialMatchRouteSnapshot, QueryParamsHandling, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, RedirectFunction, ResolveData, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterState, RoutesRecognized, RunGuardsAndResolvers, Scroll, UrlCreationOptions, UrlMatchResult, UrlMatcher, UrlSegment, UrlSegmentGroup, UrlSerializer, convertToParamMap, defaultUrlMatcher, destroyDetachedRouteHandle, isActive, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, RestoredState as ɵRestoredState } from './_router_module-chunk.js';
9
9
  import { Title } from '@angular/platform-browser';
10
10
  import * as i0 from '@angular/core';
11
11
  import { ComponentRef, EnvironmentInjector, InjectionToken, Compiler, Injector, Type, OnDestroy, EnvironmentProviders, Provider, Version } from '@angular/core';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-next.0
2
+ * @license Angular v21.2.0-next.2
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */