@angular/router 22.0.0-next.8 → 22.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_router-chunk.mjs +175 -177
- package/fesm2022/_router-chunk.mjs.map +1 -1
- package/fesm2022/_router_module-chunk.mjs +58 -68
- package/fesm2022/_router_module-chunk.mjs.map +1 -1
- package/fesm2022/router.mjs +2 -2
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/testing.mjs +17 -21
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +1 -1
- package/package.json +5 -5
- package/types/_router_module-chunk.d.ts +31 -30
- package/types/router.d.ts +5 -3
- package/types/testing.d.ts +1 -1
- package/types/upgrade.d.ts +1 -1
package/fesm2022/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-
|
|
2
|
+
* @license Angular v22.0.0-rc.0
|
|
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('22.0.0-
|
|
31
|
+
const VERSION = /* @__PURE__ */new Version('22.0.0-rc.0');
|
|
32
32
|
|
|
33
33
|
export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };
|
|
34
34
|
//# sourceMappingURL=router.mjs.map
|
package/fesm2022/router.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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('22.0.0-
|
|
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('22.0.0-rc.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;;;;"}
|
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-
|
|
2
|
+
* @license Angular v22.0.0-rc.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { NgModule, signal,
|
|
8
|
+
import { NgModule, signal, Service, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
9
9
|
import { TestBed } from '@angular/core/testing';
|
|
10
10
|
import { ROUTES, ROUTER_CONFIGURATION, Router, afterNextNavigation, RouterOutlet } from './_router-chunk.mjs';
|
|
11
11
|
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent } from './_router-chunk.mjs';
|
|
@@ -33,7 +33,7 @@ class RouterTestingModule {
|
|
|
33
33
|
}
|
|
34
34
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
35
35
|
minVersion: "12.0.0",
|
|
36
|
-
version: "22.0.0-
|
|
36
|
+
version: "22.0.0-rc.0",
|
|
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: "22.0.0-
|
|
44
|
+
version: "22.0.0-rc.0",
|
|
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: "22.0.0-
|
|
51
|
+
version: "22.0.0-rc.0",
|
|
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: "22.0.0-
|
|
64
|
+
version: "22.0.0-rc.0",
|
|
65
65
|
ngImport: i0,
|
|
66
66
|
type: RouterTestingModule,
|
|
67
67
|
decorators: [{
|
|
@@ -97,30 +97,26 @@ class RootFixtureService {
|
|
|
97
97
|
}
|
|
98
98
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
99
99
|
minVersion: "12.0.0",
|
|
100
|
-
version: "22.0.0-
|
|
100
|
+
version: "22.0.0-rc.0",
|
|
101
101
|
ngImport: i0,
|
|
102
102
|
type: RootFixtureService,
|
|
103
103
|
deps: [],
|
|
104
|
-
target: i0.ɵɵFactoryTarget.
|
|
104
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
105
105
|
});
|
|
106
|
-
static ɵprov = i0.ɵɵ
|
|
107
|
-
minVersion: "
|
|
108
|
-
version: "22.0.0-
|
|
106
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
107
|
+
minVersion: "22.0.0",
|
|
108
|
+
version: "22.0.0-rc.0",
|
|
109
109
|
ngImport: i0,
|
|
110
|
-
type: RootFixtureService
|
|
111
|
-
providedIn: 'root'
|
|
110
|
+
type: RootFixtureService
|
|
112
111
|
});
|
|
113
112
|
}
|
|
114
113
|
i0.ɵɵngDeclareClassMetadata({
|
|
115
114
|
minVersion: "12.0.0",
|
|
116
|
-
version: "22.0.0-
|
|
115
|
+
version: "22.0.0-rc.0",
|
|
117
116
|
ngImport: i0,
|
|
118
117
|
type: RootFixtureService,
|
|
119
118
|
decorators: [{
|
|
120
|
-
type:
|
|
121
|
-
args: [{
|
|
122
|
-
providedIn: 'root'
|
|
123
|
-
}]
|
|
119
|
+
type: Service
|
|
124
120
|
}]
|
|
125
121
|
});
|
|
126
122
|
class RootCmp {
|
|
@@ -130,7 +126,7 @@ class RootCmp {
|
|
|
130
126
|
}] : []));
|
|
131
127
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
132
128
|
minVersion: "12.0.0",
|
|
133
|
-
version: "22.0.0-
|
|
129
|
+
version: "22.0.0-rc.0",
|
|
134
130
|
ngImport: i0,
|
|
135
131
|
type: RootCmp,
|
|
136
132
|
deps: [],
|
|
@@ -138,7 +134,7 @@ class RootCmp {
|
|
|
138
134
|
});
|
|
139
135
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
140
136
|
minVersion: "14.0.0",
|
|
141
|
-
version: "22.0.0-
|
|
137
|
+
version: "22.0.0-rc.0",
|
|
142
138
|
type: RootCmp,
|
|
143
139
|
isStandalone: true,
|
|
144
140
|
selector: "ng-component",
|
|
@@ -164,7 +160,7 @@ class RootCmp {
|
|
|
164
160
|
}
|
|
165
161
|
i0.ɵɵngDeclareClassMetadata({
|
|
166
162
|
minVersion: "12.0.0",
|
|
167
|
-
version: "22.0.0-
|
|
163
|
+
version: "22.0.0-rc.0",
|
|
168
164
|
ngImport: i0,
|
|
169
165
|
type: RootCmp,
|
|
170
166
|
decorators: [{
|
package/fesm2022/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 ChangeDetectionStrategy,\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 changeDetection: ChangeDetectionStrategy.Eager,\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","changeDetection","ChangeDetectionStrategy","Eager","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;AAAM,OAAC,EAChD;AAACI,QAAAA,OAAO,EAAEI,oBAAoB;AAAED,QAAAA,QAAQ,EAAEN,MAAM,GAAGA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AA,IAAI,CAACxD,OAAO,CAACU,aAAa,EAAE;IAC5B,MAAMK,MAAM,GAAI,IAAI,CAACf,OAAO,CAAC2C,iBAA6B,CAAC5B,MAAM;IAGjE,IAAIA,MAAM,IAAIA,MAAM,CAAC6B,WAAW,IAAI7B,MAAM,CAAC6C,cAAc,CAACZ,SAAS,EAAE;AACnE,MAAA,MAAMa,kBAAkB,GAAG9C,MAAM,CAACiC,SAAS;MAC3C,IACEI,2BAA2B,KAAK9C,SAAS,IACzC,EAAEuD,kBAAkB,YAAYT,2BAA2B,CAAC,EAC5D;AACA,QAAA,MAAM,IAAIjD,KAAK,CACb,CAAA,2CAAA,EAA8CiD,2BAA2B,CAACU,IAAI,CAAA,SAAA,EAAYD,kBAAkB,CAACpB,WAAW,CAACqB,IAAI,EAAE,CAChI;AACH,MAAA;AACA,MAAA,OAAOD,kBAAuB;AAChC,IAAA,CAAA,MAAO;MACL,IAAIT,2BAA2B,KAAK9C,SAAS,EAAE;QAC7C,MAAM,IAAIH,KAAK,CACb,CAAA,2CAAA,EAA8CiD,2BAA2B,CAACU,IAAI,qDAAqD,CACpI;AACH,MAAA;AACA,MAAA,OAAO,IAAI;AACb,IAAA;AACF,EAAA;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 ChangeDetectionStrategy,\n Component,\n DebugElement,\n Service,\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@Service()\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 changeDetection: ChangeDetectionStrategy.Eager,\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","Service","outlet","routerOutletData","signal","Component","ɵcmp","ɵɵngDeclareComponent","isStandalone","selector","viewQueries","propertyName","first","predicate","RouterOutlet","descendants","template","inputs","outputs","exportAs","changeDetection","ChangeDetectionStrategy","Eager","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;AAAM,OAAC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,CAAC6B,WAAW,IAAI7B,MAAM,CAAC6C,cAAc,CAACZ,SAAS,EAAE;AACnE,MAAA,MAAMa,kBAAkB,GAAG9C,MAAM,CAACiC,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,CAAA,SAAA,EAAYD,kBAAkB,CAACpB,WAAW,CAACqB,IAAI,EAAE,CAChI;AACH,MAAA;AACA,MAAA,OAAOD,kBAAuB;AAChC,IAAA,CAAA,MAAO;MACL,IAAIT,2BAA2B,KAAK3C,SAAS,EAAE;QAC7C,MAAM,IAAIH,KAAK,CACb,CAAA,2CAAA,EAA8C8C,2BAA2B,CAACU,IAAI,qDAAqD,CACpI;AACH,MAAA;AACA,MAAA,OAAO,IAAI;AACb,IAAA;AACF,EAAA;AACD;;;;"}
|
package/fesm2022/upgrade.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router",
|
|
3
|
-
"version": "22.0.0-
|
|
3
|
+
"version": "22.0.0-rc.0",
|
|
4
4
|
"description": "Angular - the routing library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "angular",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "^22.22.0 ||
|
|
17
|
+
"node": "^22.22.0 || ^24.13.1 || >=26.0.0"
|
|
18
18
|
},
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/angular/angular/issues"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@types/dom-navigation": "^1.0.5"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@angular/core": "22.0.0-
|
|
31
|
-
"@angular/common": "22.0.0-
|
|
32
|
-
"@angular/platform-browser": "22.0.0-
|
|
30
|
+
"@angular/core": "22.0.0-rc.0",
|
|
31
|
+
"@angular/common": "22.0.0-rc.0",
|
|
32
|
+
"@angular/platform-browser": "22.0.0-rc.0",
|
|
33
33
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
34
34
|
},
|
|
35
35
|
"ng-update": {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-
|
|
2
|
+
* @license Angular v22.0.0-rc.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { InjectionToken, EnvironmentInjector, ComponentRef, EventEmitter, Signal, OnDestroy, OnInit, SimpleChanges, Type, ProviderToken, NgModuleFactory, Provider, EnvironmentProviders, OnChanges, Renderer2, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, ModuleWithProviders } from '@angular/core';
|
|
8
|
+
import { InjectionToken, EnvironmentInjector, ComponentRef, EventEmitter, Signal, OnDestroy, OnInit, SimpleChanges, Type, DefaultExport, ProviderToken, NgModuleFactory, Provider, EnvironmentProviders, OnChanges, Renderer2, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, ModuleWithProviders } from '@angular/core';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
10
10
|
import { LocationStrategy } from '@angular/common';
|
|
11
11
|
|
|
@@ -763,11 +763,11 @@ interface RouterConfigOptions {
|
|
|
763
763
|
* Defines how the router merges parameters, data, and resolved data from parent to child
|
|
764
764
|
* routes.
|
|
765
765
|
*
|
|
766
|
-
* By default ('
|
|
767
|
-
* has an empty path (meaning its configured with path: '') or when the parent route doesn't have
|
|
768
|
-
* any component set.
|
|
766
|
+
* By default ('always'), a route inherits all parameters from its parent routes.
|
|
769
767
|
*
|
|
770
|
-
* Set to '
|
|
768
|
+
* Set to 'emptyOnly' to preserve the legacy behavior where a route only inherits the parent
|
|
769
|
+
* route's parameters when the route itself has an empty path or when the parent route doesn't
|
|
770
|
+
* have any component set.
|
|
771
771
|
*
|
|
772
772
|
* Note that when dealing with matrix parameters, "parent" refers to the parent `Route`
|
|
773
773
|
* config which does not necessarily mean the "URL segment to the left". When the `Route` `path`
|
|
@@ -884,12 +884,22 @@ interface ComponentInputBindingOptions {
|
|
|
884
884
|
* inputs.
|
|
885
885
|
*/
|
|
886
886
|
queryParams?: boolean;
|
|
887
|
+
/**
|
|
888
|
+
* Configures the behavior when an input is not matched by any key in the router data.
|
|
889
|
+
*
|
|
890
|
+
* - `'alwaysUndefined'`: (Default) Binds `undefined` to the input. This ensures that stale data
|
|
891
|
+
* is not retained.
|
|
892
|
+
* - `'undefinedIfStale'`: Binds `undefined` only if the input was previously available
|
|
893
|
+
* in the router data during the lifetime of the active route in this outlet. This avoids
|
|
894
|
+
* setting `undefined` for inputs that were never expected to be set by the router.
|
|
895
|
+
*/
|
|
896
|
+
unmatchedInputBehavior?: 'alwaysUndefined' | 'undefinedIfStale';
|
|
887
897
|
}
|
|
888
898
|
/**
|
|
889
899
|
* A set of configuration options for a router module, provided in the
|
|
890
900
|
* `forRoot()` method.
|
|
891
901
|
*
|
|
892
|
-
* @see {@link /api/router/
|
|
902
|
+
* @see {@link /api/router/RouterModule#forRoot forRoot}
|
|
893
903
|
*
|
|
894
904
|
*
|
|
895
905
|
* @publicApi
|
|
@@ -1302,6 +1312,7 @@ type RestoredState = {
|
|
|
1302
1312
|
[k: string]: any;
|
|
1303
1313
|
navigationId: number;
|
|
1304
1314
|
ɵrouterPageId?: number;
|
|
1315
|
+
ɵrouterUrl?: string;
|
|
1305
1316
|
};
|
|
1306
1317
|
/**
|
|
1307
1318
|
* Information about a navigation operation.
|
|
@@ -2146,21 +2157,6 @@ type Data = {
|
|
|
2146
2157
|
type ResolveData = {
|
|
2147
2158
|
[key: string | symbol]: ResolveFn<unknown> | DeprecatedResolve;
|
|
2148
2159
|
};
|
|
2149
|
-
/**
|
|
2150
|
-
* An ES Module object with a default export of the given type.
|
|
2151
|
-
*
|
|
2152
|
-
* @see {@link Route#loadComponent}
|
|
2153
|
-
* @see {@link LoadChildrenCallback}
|
|
2154
|
-
*
|
|
2155
|
-
* @publicApi
|
|
2156
|
-
*/
|
|
2157
|
-
interface DefaultExport<T> {
|
|
2158
|
-
/**
|
|
2159
|
-
* Default exports are bound under the name `"default"`, per the ES Module spec:
|
|
2160
|
-
* https://tc39.es/ecma262/#table-export-forms-mapping-to-exportentry-records
|
|
2161
|
-
*/
|
|
2162
|
-
default: T;
|
|
2163
|
-
}
|
|
2164
2160
|
/**
|
|
2165
2161
|
*
|
|
2166
2162
|
* A function that is called to resolve a collection of lazy-loaded routes.
|
|
@@ -2693,7 +2689,8 @@ interface LoadedRouterConfig {
|
|
|
2693
2689
|
*
|
|
2694
2690
|
* @Injectable()
|
|
2695
2691
|
* class CanActivateTeam implements CanActivate {
|
|
2696
|
-
*
|
|
2692
|
+
* private readonly permissions = inject(Permissions);
|
|
2693
|
+
* private readonly currentUser = inject(UserToken);
|
|
2697
2694
|
*
|
|
2698
2695
|
* canActivate(
|
|
2699
2696
|
* route: ActivatedRouteSnapshot,
|
|
@@ -2806,7 +2803,8 @@ type CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot)
|
|
|
2806
2803
|
*
|
|
2807
2804
|
* @Injectable()
|
|
2808
2805
|
* class CanActivateTeam implements CanActivateChild {
|
|
2809
|
-
*
|
|
2806
|
+
* private readonly permissions = inject(Permissions);
|
|
2807
|
+
* private readonly currentUser = inject(UserToken);
|
|
2810
2808
|
*
|
|
2811
2809
|
* canActivateChild(
|
|
2812
2810
|
* route: ActivatedRouteSnapshot,
|
|
@@ -2889,7 +2887,8 @@ type CanActivateChildFn = (childRoute: ActivatedRouteSnapshot, state: RouterStat
|
|
|
2889
2887
|
* ```ts
|
|
2890
2888
|
* @Injectable()
|
|
2891
2889
|
* class CanDeactivateTeam implements CanDeactivate<TeamComponent> {
|
|
2892
|
-
*
|
|
2890
|
+
* private readonly permissions = inject(Permissions);
|
|
2891
|
+
* private readonly currentUser = inject(UserToken);
|
|
2893
2892
|
*
|
|
2894
2893
|
* canDeactivate(
|
|
2895
2894
|
* component: TeamComponent,
|
|
@@ -2960,7 +2959,8 @@ type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, c
|
|
|
2960
2959
|
*
|
|
2961
2960
|
* @Injectable()
|
|
2962
2961
|
* class CanMatchTeamSection implements CanMatch {
|
|
2963
|
-
*
|
|
2962
|
+
* private readonly permissions = inject(Permissions);
|
|
2963
|
+
* private readonly currentUser = inject(UserToken);
|
|
2964
2964
|
*
|
|
2965
2965
|
* canMatch(
|
|
2966
2966
|
* route: Route,
|
|
@@ -3054,7 +3054,7 @@ type PartialMatchRouteSnapshot = Pick<ActivatedRouteSnapshot, 'routeConfig' | 'u
|
|
|
3054
3054
|
* ```ts
|
|
3055
3055
|
* @Injectable({ providedIn: 'root' })
|
|
3056
3056
|
* export class HeroResolver implements Resolve<Hero> {
|
|
3057
|
-
*
|
|
3057
|
+
* private readonly service = inject(HeroService);
|
|
3058
3058
|
*
|
|
3059
3059
|
* resolve(
|
|
3060
3060
|
* route: ActivatedRouteSnapshot,
|
|
@@ -3095,7 +3095,7 @@ type PartialMatchRouteSnapshot = Pick<ActivatedRouteSnapshot, 'routeConfig' | 'u
|
|
|
3095
3095
|
* })
|
|
3096
3096
|
* export class HeroComponent {
|
|
3097
3097
|
*
|
|
3098
|
-
*
|
|
3098
|
+
* private readonly activatedRoute = inject(ActivatedRoute);
|
|
3099
3099
|
*
|
|
3100
3100
|
* ngOnInit() {
|
|
3101
3101
|
* this.activatedRoute.data.subscribe(({ hero }) => {
|
|
@@ -3262,7 +3262,8 @@ type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot)
|
|
|
3262
3262
|
*
|
|
3263
3263
|
* @Injectable()
|
|
3264
3264
|
* class CanLoadTeamSection implements CanLoad {
|
|
3265
|
-
*
|
|
3265
|
+
* private readonly permissions = inject(Permissions);
|
|
3266
|
+
* private readonly currentUser = inject(UserToken);
|
|
3266
3267
|
*
|
|
3267
3268
|
* canLoad(route: Route, segments: UrlSegment[]): Observable<boolean>|Promise<boolean>|boolean {
|
|
3268
3269
|
* return this.permissions.canLoadChildren(this.currentUser, route, segments);
|
|
@@ -4154,4 +4155,4 @@ declare class RouterModule {
|
|
|
4154
4155
|
declare const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;
|
|
4155
4156
|
|
|
4156
4157
|
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 };
|
|
4157
|
-
export type { CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanLoad, CanLoadFn, CanMatch, CanMatchFn, ComponentInputBindingOptions, Data,
|
|
4158
|
+
export type { CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanLoad, CanLoadFn, CanMatch, CanMatchFn, ComponentInputBindingOptions, Data, 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,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-
|
|
2
|
+
* @license Angular v22.0.0-rc.0
|
|
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, ComponentInputBindingOptions, InMemoryScrollingOptions, NavigationError, RedirectCommand, RouterConfigOptions, CanActivate, CanActivateFn, CanActivateChild, CanActivateChildFn, CanDeactivate, CanDeactivateFn, CanMatch, CanMatchFn, Resolve, ResolveFn, Event } from './_router_module-chunk.js';
|
|
8
|
-
export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data,
|
|
8
|
+
export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, 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 { EnvironmentInjector, ComponentRef, InjectionToken, Type, Injector, Compiler, OnDestroy, Provider, EnvironmentProviders, Version } from '@angular/core';
|
|
12
|
+
export { DefaultExport } from '@angular/core';
|
|
12
13
|
import { Observable } from 'rxjs';
|
|
13
14
|
import '@angular/common';
|
|
14
15
|
|
|
@@ -755,7 +756,8 @@ type ExperimentalAutoCleanupInjectorsFeature = RouterFeature<RouterFeatureKind.E
|
|
|
755
756
|
*
|
|
756
757
|
* This feature is opt-in and requires `RouteReuseStrategy.shouldDestroyInjector` to return `true`
|
|
757
758
|
* for the routes that should be destroyed. If the `RouteReuseStrategy` uses stored handles, it
|
|
758
|
-
* should also implement `
|
|
759
|
+
* should also implement `retrieveStoredRouteHandles` to ensure injectors for handles that will be
|
|
760
|
+
* reattached are not destroyed.
|
|
759
761
|
*
|
|
760
762
|
* @experimental 21.1
|
|
761
763
|
*/
|
package/types/testing.d.ts
CHANGED
package/types/upgrade.d.ts
CHANGED