@angular/router 21.0.0-rc.2 → 21.0.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 +49 -49
- package/fesm2022/_router-chunk.mjs.map +1 -1
- package/fesm2022/_router_module-chunk.mjs +26 -26
- 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 +11 -11
- package/fesm2022/upgrade.mjs +1 -1
- package/package.json +4 -4
- package/types/_router_module-chunk.d.ts +48 -3
- package/types/router.d.ts +7 -1
- 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 v21.0.0
|
|
2
|
+
* @license Angular v21.0.0
|
|
3
3
|
* (c) 2010-2025 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.0.0
|
|
31
|
+
const VERSION = /* @__PURE__ */new Version('21.0.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":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/utils/functional_guards.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/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.0.0
|
|
1
|
+
{"version":3,"file":"router.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/utils/functional_guards.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/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.0.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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0
|
|
2
|
+
* @license Angular v21.0.0
|
|
3
3
|
* (c) 2010-2025 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.0.0
|
|
36
|
+
version: "21.0.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: "21.0.0
|
|
44
|
+
version: "21.0.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: "21.0.0
|
|
51
|
+
version: "21.0.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: "21.0.0
|
|
64
|
+
version: "21.0.0",
|
|
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.0.0
|
|
100
|
+
version: "21.0.0",
|
|
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.0.0
|
|
108
|
+
version: "21.0.0",
|
|
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.0.0
|
|
116
|
+
version: "21.0.0",
|
|
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.0.0
|
|
133
|
+
version: "21.0.0",
|
|
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.0.0
|
|
141
|
+
version: "21.0.0",
|
|
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.0.0
|
|
166
|
+
version: "21.0.0",
|
|
167
167
|
ngImport: i0,
|
|
168
168
|
type: RootCmp,
|
|
169
169
|
decorators: [{
|
package/fesm2022/upgrade.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router",
|
|
3
|
-
"version": "21.0.0
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Angular - the routing library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"tslib": "^2.3.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@angular/core": "21.0.0
|
|
28
|
-
"@angular/common": "21.0.0
|
|
29
|
-
"@angular/platform-browser": "21.0.0
|
|
27
|
+
"@angular/core": "21.0.0",
|
|
28
|
+
"@angular/common": "21.0.0",
|
|
29
|
+
"@angular/platform-browser": "21.0.0",
|
|
30
30
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
31
31
|
},
|
|
32
32
|
"ng-update": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0
|
|
2
|
+
* @license Angular v21.0.0
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -451,6 +451,7 @@ type UrlMatchResult = {
|
|
|
451
451
|
* export const routes = [{ matcher: htmlFiles, component: AnyComponent }];
|
|
452
452
|
* ```
|
|
453
453
|
*
|
|
454
|
+
* @see [Creating custom route matches](guide/routing/routing-with-urlmatcher)
|
|
454
455
|
* @publicApi
|
|
455
456
|
*/
|
|
456
457
|
type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult | null;
|
|
@@ -586,6 +587,7 @@ type RedirectFunction = (redirectData: Pick<ActivatedRouteSnapshot, 'routeConfig
|
|
|
586
587
|
* change or query params have changed. This does not include matrix parameters.
|
|
587
588
|
*
|
|
588
589
|
* @see {@link Route#runGuardsAndResolvers}
|
|
590
|
+
* @see [Control when guards and resolvers execute](guide/routing/customizing-route-behavior#control-when-guards-and-resolvers-execute)
|
|
589
591
|
* @publicApi
|
|
590
592
|
*/
|
|
591
593
|
type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParamsChange' | 'paramsChange' | 'paramsOrQueryParamsChange' | 'always' | ((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean);
|
|
@@ -820,6 +822,7 @@ interface Route {
|
|
|
820
822
|
* implements `Resolve`.
|
|
821
823
|
*
|
|
822
824
|
* @see {@link TitleStrategy}
|
|
825
|
+
* @see [Page titles](guide/routing/define-routes#page-titles)
|
|
823
826
|
*/
|
|
824
827
|
title?: string | Type<Resolve<string>> | ResolveFn<string>;
|
|
825
828
|
/**
|
|
@@ -848,10 +851,15 @@ interface Route {
|
|
|
848
851
|
* the router would apply the redirect even when navigating
|
|
849
852
|
* to the redirect destination, creating an endless loop.
|
|
850
853
|
*
|
|
854
|
+
* @see [Redirecting Routes](guide/routing/redirecting-routes)
|
|
855
|
+
*
|
|
851
856
|
*/
|
|
852
857
|
pathMatch?: 'prefix' | 'full';
|
|
853
858
|
/**
|
|
854
859
|
* A custom URL-matching function. Cannot be used together with `path`.
|
|
860
|
+
*
|
|
861
|
+
* @see [Creating custom route matches](guide/routing/routing-with-urlmatcher)
|
|
862
|
+
*
|
|
855
863
|
*/
|
|
856
864
|
matcher?: UrlMatcher;
|
|
857
865
|
/**
|
|
@@ -876,11 +884,16 @@ interface Route {
|
|
|
876
884
|
* required dependencies.
|
|
877
885
|
*
|
|
878
886
|
* When not present, router does not redirect.
|
|
887
|
+
*
|
|
888
|
+
* @see [Conditional redirects](guide/routing/redirecting-routes#conditional-redirects)
|
|
879
889
|
*/
|
|
880
890
|
redirectTo?: string | RedirectFunction;
|
|
881
891
|
/**
|
|
882
892
|
* Name of a `RouterOutlet` object where the component can be placed
|
|
883
893
|
* when the path matches.
|
|
894
|
+
*
|
|
895
|
+
* @see [Show routes with outlets](guide/routing/show-routes-with-outlets)
|
|
896
|
+
*
|
|
884
897
|
*/
|
|
885
898
|
outlet?: string;
|
|
886
899
|
/**
|
|
@@ -890,6 +903,9 @@ interface Route {
|
|
|
890
903
|
*
|
|
891
904
|
* When using a function rather than DI tokens, the function can call `inject` to get any required
|
|
892
905
|
* dependencies. This `inject` call must be done in a synchronous context.
|
|
906
|
+
*
|
|
907
|
+
* @see [CanActivate](guide/routing/route-guards#canactivate)
|
|
908
|
+
*
|
|
893
909
|
*/
|
|
894
910
|
canActivate?: Array<CanActivateFn | DeprecatedGuard>;
|
|
895
911
|
/**
|
|
@@ -899,6 +915,9 @@ interface Route {
|
|
|
899
915
|
*
|
|
900
916
|
* When using a function rather than DI tokens, the function can call `inject` to get any required
|
|
901
917
|
* dependencies. This `inject` call must be done in a synchronous context.
|
|
918
|
+
*
|
|
919
|
+
* @see [CanMatch](guide/routing/route-guards#canmatch)
|
|
920
|
+
*
|
|
902
921
|
*/
|
|
903
922
|
canMatch?: Array<CanMatchFn | DeprecatedGuard>;
|
|
904
923
|
/**
|
|
@@ -908,6 +927,9 @@ interface Route {
|
|
|
908
927
|
*
|
|
909
928
|
* When using a function rather than DI tokens, the function can call `inject` to get any required
|
|
910
929
|
* dependencies. This `inject` call must be done in a synchronous context.
|
|
930
|
+
*
|
|
931
|
+
* @see [CanActivateChild](guide/routing/route-guards#canactivatechild)
|
|
932
|
+
*
|
|
911
933
|
*/
|
|
912
934
|
canActivateChild?: Array<CanActivateChildFn | DeprecatedGuard>;
|
|
913
935
|
/**
|
|
@@ -917,6 +939,9 @@ interface Route {
|
|
|
917
939
|
*
|
|
918
940
|
* When using a function rather than DI tokens, the function can call `inject` to get any required
|
|
919
941
|
* dependencies. This `inject` call must be done in a synchronous context.
|
|
942
|
+
*
|
|
943
|
+
* @see [CanDeactivate](guide/routing/route-guards#candeactivate)
|
|
944
|
+
*
|
|
920
945
|
*/
|
|
921
946
|
canDeactivate?: Array<CanDeactivateFn<any> | DeprecatedGuard>;
|
|
922
947
|
/**
|
|
@@ -936,6 +961,8 @@ interface Route {
|
|
|
936
961
|
data?: Data;
|
|
937
962
|
/**
|
|
938
963
|
* A map of DI tokens used to look up data resolvers. See `Resolve`.
|
|
964
|
+
*
|
|
965
|
+
* @see [Resolve](guide/routing/data-resolvers#what-are-data-resolvers)
|
|
939
966
|
*/
|
|
940
967
|
resolve?: ResolveData;
|
|
941
968
|
/**
|
|
@@ -966,6 +993,7 @@ interface Route {
|
|
|
966
993
|
* change or query params have changed. This does not include matrix parameters.
|
|
967
994
|
*
|
|
968
995
|
* @see {@link RunGuardsAndResolvers}
|
|
996
|
+
* @see [Control when guards and resolvers execute](guide/routing/customizing-route-behavior#control-when-guards-and-resolvers-execute)
|
|
969
997
|
*/
|
|
970
998
|
runGuardsAndResolvers?: RunGuardsAndResolvers;
|
|
971
999
|
/**
|
|
@@ -975,6 +1003,7 @@ interface Route {
|
|
|
975
1003
|
* `Route` and use it for this `Route` and its `children`. If this
|
|
976
1004
|
* route also has a `loadChildren` function which returns an `NgModuleRef`, this injector will be
|
|
977
1005
|
* used as the parent of the lazy loaded module.
|
|
1006
|
+
* @see [Route providers](guide/di/defining-dependency-providers#route-providers)
|
|
978
1007
|
*/
|
|
979
1008
|
providers?: Array<Provider | EnvironmentProviders>;
|
|
980
1009
|
}
|
|
@@ -1033,6 +1062,9 @@ interface LoadedRouterConfig {
|
|
|
1033
1062
|
* class AppModule {}
|
|
1034
1063
|
* ```
|
|
1035
1064
|
*
|
|
1065
|
+
* @see [CanActivate](guide/routing/route-guards#canactivate)
|
|
1066
|
+
*
|
|
1067
|
+
*
|
|
1036
1068
|
* @publicApi
|
|
1037
1069
|
*/
|
|
1038
1070
|
interface CanActivate {
|
|
@@ -1089,6 +1121,7 @@ interface CanActivate {
|
|
|
1089
1121
|
*
|
|
1090
1122
|
* @publicApi
|
|
1091
1123
|
* @see {@link Route}
|
|
1124
|
+
* @see [CanActivate](guide/routing/route-guards#canactivate)
|
|
1092
1125
|
*/
|
|
1093
1126
|
type CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MaybeAsync<GuardResult>;
|
|
1094
1127
|
/**
|
|
@@ -1146,7 +1179,7 @@ type CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot)
|
|
|
1146
1179
|
* })
|
|
1147
1180
|
* class AppModule {}
|
|
1148
1181
|
* ```
|
|
1149
|
-
*
|
|
1182
|
+
* @see [CanActivateChild](guide/routing/route-guards#canactivatechild)
|
|
1150
1183
|
* @publicApi
|
|
1151
1184
|
*/
|
|
1152
1185
|
interface CanActivateChild {
|
|
@@ -1166,6 +1199,7 @@ interface CanActivateChild {
|
|
|
1166
1199
|
*
|
|
1167
1200
|
* @publicApi
|
|
1168
1201
|
* @see {@link Route}
|
|
1202
|
+
* @see [CanActivateChild](guide/routing/route-guards#canactivatechild)
|
|
1169
1203
|
*/
|
|
1170
1204
|
type CanActivateChildFn = (childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MaybeAsync<GuardResult>;
|
|
1171
1205
|
/**
|
|
@@ -1220,7 +1254,7 @@ type CanActivateChildFn = (childRoute: ActivatedRouteSnapshot, state: RouterStat
|
|
|
1220
1254
|
* })
|
|
1221
1255
|
* class AppModule {}
|
|
1222
1256
|
* ```
|
|
1223
|
-
*
|
|
1257
|
+
* @see [CanDeactivate](guide/routing/route-guards#candeactivate)
|
|
1224
1258
|
* @publicApi
|
|
1225
1259
|
*/
|
|
1226
1260
|
interface CanDeactivate<T> {
|
|
@@ -1240,6 +1274,7 @@ interface CanDeactivate<T> {
|
|
|
1240
1274
|
*
|
|
1241
1275
|
* @publicApi
|
|
1242
1276
|
* @see {@link Route}
|
|
1277
|
+
* @see [CanDeactivate](guide/routing/route-guards#candeactivate)
|
|
1243
1278
|
*/
|
|
1244
1279
|
type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot) => MaybeAsync<GuardResult>;
|
|
1245
1280
|
/**
|
|
@@ -1301,6 +1336,7 @@ type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, c
|
|
|
1301
1336
|
* could not be used for a URL match but the catch-all `**` `Route` did instead.
|
|
1302
1337
|
*
|
|
1303
1338
|
* @publicApi
|
|
1339
|
+
* @see [CanMatch](guide/routing/route-guards#canmatch)
|
|
1304
1340
|
*/
|
|
1305
1341
|
interface CanMatch {
|
|
1306
1342
|
canMatch(route: Route, segments: UrlSegment[]): MaybeAsync<GuardResult>;
|
|
@@ -1322,6 +1358,7 @@ interface CanMatch {
|
|
|
1322
1358
|
*
|
|
1323
1359
|
* @publicApi
|
|
1324
1360
|
* @see {@link Route}
|
|
1361
|
+
* @see [CanMatch](guide/routing/route-guards#canmatch)
|
|
1325
1362
|
*/
|
|
1326
1363
|
type CanMatchFn = (route: Route, segments: UrlSegment[]) => MaybeAsync<GuardResult>;
|
|
1327
1364
|
/**
|
|
@@ -1415,6 +1452,7 @@ type CanMatchFn = (route: Route, segments: UrlSegment[]) => MaybeAsync<GuardResu
|
|
|
1415
1452
|
*
|
|
1416
1453
|
* @publicApi
|
|
1417
1454
|
* @see {@link ResolveFn}
|
|
1455
|
+
* @see [Data resolvers](guide/routing/data-resolvers)
|
|
1418
1456
|
*/
|
|
1419
1457
|
interface Resolve<T> {
|
|
1420
1458
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): MaybeAsync<T | RedirectCommand>;
|
|
@@ -1520,6 +1558,7 @@ interface Resolve<T> {
|
|
|
1520
1558
|
*
|
|
1521
1559
|
* @publicApi
|
|
1522
1560
|
* @see {@link Route}
|
|
1561
|
+
* @see [Data resolvers](guide/routing/data-resolvers)
|
|
1523
1562
|
*/
|
|
1524
1563
|
type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MaybeAsync<T | RedirectCommand>;
|
|
1525
1564
|
/**
|
|
@@ -1839,6 +1878,8 @@ declare class ActivatedRoute {
|
|
|
1839
1878
|
* }
|
|
1840
1879
|
* ```
|
|
1841
1880
|
*
|
|
1881
|
+
* @see [Understanding route snapshots](guide/routing/read-route-state#understanding-route-snapshots)
|
|
1882
|
+
*
|
|
1842
1883
|
* @publicApi
|
|
1843
1884
|
*/
|
|
1844
1885
|
declare class ActivatedRouteSnapshot {
|
|
@@ -1938,6 +1979,8 @@ type NavigationTrigger = 'imperative' | 'popstate' | 'hashchange';
|
|
|
1938
1979
|
/**
|
|
1939
1980
|
* Identifies the type of a router event.
|
|
1940
1981
|
*
|
|
1982
|
+
* @see [Router Lifecycle and Events](guide/routing/lifecycle-and-events)
|
|
1983
|
+
*
|
|
1941
1984
|
* @publicApi
|
|
1942
1985
|
*/
|
|
1943
1986
|
declare enum EventType {
|
|
@@ -3569,6 +3612,8 @@ declare class RouterLink implements OnChanges, OnDestroy {
|
|
|
3569
3612
|
*
|
|
3570
3613
|
* @ngModule RouterModule
|
|
3571
3614
|
*
|
|
3615
|
+
* @see [Detect active current route with RouterLinkActive](guide/routing/read-route-state#detect-active-current-route-with-routerlinkactive)
|
|
3616
|
+
*
|
|
3572
3617
|
* @publicApi
|
|
3573
3618
|
*/
|
|
3574
3619
|
declare class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {
|
package/types/router.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0
|
|
2
|
+
* @license Angular v21.0.0
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -587,6 +587,8 @@ type PreloadingFeature = RouterFeature<RouterFeatureKind.PreloadingFeature>;
|
|
|
587
587
|
* should be used.
|
|
588
588
|
* @returns A set of providers for use with `provideRouter`.
|
|
589
589
|
*
|
|
590
|
+
* @see [Preloading strategy](guide/routing/customizing-route-behavior#preloading-strategy)
|
|
591
|
+
*
|
|
590
592
|
* @publicApi
|
|
591
593
|
*/
|
|
592
594
|
declare function withPreloading(preloadingStrategy: Type<PreloadingStrategy>): PreloadingFeature;
|
|
@@ -624,6 +626,8 @@ type RouterConfigurationFeature = RouterFeature<RouterFeatureKind.RouterConfigur
|
|
|
624
626
|
* additional information.
|
|
625
627
|
* @returns A set of providers for use with `provideRouter`.
|
|
626
628
|
*
|
|
629
|
+
* @see [Router configuration options](guide/routing/customizing-route-behavior#router-configuration-options)
|
|
630
|
+
*
|
|
627
631
|
* @publicApi
|
|
628
632
|
*/
|
|
629
633
|
declare function withRouterConfig(options: RouterConfigOptions): RouterConfigurationFeature;
|
|
@@ -700,6 +704,7 @@ type NavigationErrorHandlerFeature = RouterFeature<RouterFeatureKind.NavigationE
|
|
|
700
704
|
* @see {@link NavigationError}
|
|
701
705
|
* @see {@link /api/core/inject inject}
|
|
702
706
|
* @see {@link runInInjectionContext}
|
|
707
|
+
* @see [Centralize error handling in withNavigationErrorHandler](guide/routing/data-resolvers#centralize-error-handling-in-withnavigationerrorhandler)
|
|
703
708
|
*
|
|
704
709
|
* @returns A set of providers for use with `provideRouter`.
|
|
705
710
|
*
|
|
@@ -788,6 +793,7 @@ declare function withComponentInputBinding(): ComponentInputBindingFeature;
|
|
|
788
793
|
* @returns A set of providers for use with `provideRouter`.
|
|
789
794
|
* @see https://developer.chrome.com/docs/web-platform/view-transitions/
|
|
790
795
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
|
|
796
|
+
* @see [Route transition animations](guide/routing/route-transition-animations)
|
|
791
797
|
* @developerPreview 19.0
|
|
792
798
|
*/
|
|
793
799
|
declare function withViewTransitions(options?: ViewTransitionsFeatureOptions): ViewTransitionsFeature;
|
package/types/testing.d.ts
CHANGED
package/types/upgrade.d.ts
CHANGED