@angular/router 21.0.0-next.9 → 21.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_router-chunk.mjs +4395 -5949
- package/fesm2022/_router-chunk.mjs.map +1 -1
- package/fesm2022/_router_module-chunk.mjs +1097 -1600
- package/fesm2022/_router_module-chunk.mjs.map +1 -1
- package/fesm2022/router.mjs +8 -61
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/testing.mjs +200 -168
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +38 -112
- package/fesm2022/upgrade.mjs.map +1 -1
- package/package.json +4 -4
- package/types/_router_module-chunk.d.ts +17 -1
- package/types/router.d.ts +29 -2
- package/types/testing.d.ts +1 -1
- package/types/upgrade.d.ts +1 -1
package/fesm2022/upgrade.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-
|
|
2
|
+
* @license Angular v21.0.0-rc.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -12,129 +12,55 @@ import 'rxjs';
|
|
|
12
12
|
import 'rxjs/operators';
|
|
13
13
|
import '@angular/platform-browser';
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Creates an initializer that sets up `ngRoute` integration
|
|
17
|
-
* along with setting up the Angular router.
|
|
18
|
-
*
|
|
19
|
-
* @usageNotes
|
|
20
|
-
*
|
|
21
|
-
* For standalone applications:
|
|
22
|
-
* ```ts
|
|
23
|
-
* export const appConfig: ApplicationConfig = {
|
|
24
|
-
* providers: [RouterUpgradeInitializer],
|
|
25
|
-
* };
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* For NgModule based applications:
|
|
29
|
-
* ```ts
|
|
30
|
-
* @NgModule({
|
|
31
|
-
* imports: [
|
|
32
|
-
* RouterModule.forRoot(SOME_ROUTES),
|
|
33
|
-
* UpgradeModule
|
|
34
|
-
* ],
|
|
35
|
-
* providers: [
|
|
36
|
-
* RouterUpgradeInitializer
|
|
37
|
-
* ]
|
|
38
|
-
* })
|
|
39
|
-
* export class AppModule {
|
|
40
|
-
* ngDoBootstrap() {}
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @publicApi
|
|
45
|
-
*/
|
|
46
15
|
const RouterUpgradeInitializer = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
provide: APP_BOOTSTRAP_LISTENER,
|
|
17
|
+
multi: true,
|
|
18
|
+
useFactory: locationSyncBootstrapListener
|
|
50
19
|
};
|
|
51
|
-
/**
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
20
|
function locationSyncBootstrapListener() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
21
|
+
const ngUpgrade = inject(UpgradeModule);
|
|
22
|
+
return () => {
|
|
23
|
+
setUpLocationSync(ngUpgrade);
|
|
24
|
+
};
|
|
59
25
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Sets up a location change listener to trigger `history.pushState`.
|
|
62
|
-
* Works around the problem that `onPopState` does not trigger `history.pushState`.
|
|
63
|
-
* Must be called *after* calling `UpgradeModule.bootstrap`.
|
|
64
|
-
*
|
|
65
|
-
* @param ngUpgrade The upgrade NgModule.
|
|
66
|
-
* @param urlType The location strategy.
|
|
67
|
-
* @see {@link /api/common/HashLocationStrategy HashLocationStrategy}
|
|
68
|
-
* @see {@link /api/common/PathLocationStrategy PathLocationStrategy}
|
|
69
|
-
*
|
|
70
|
-
* @publicApi
|
|
71
|
-
*/
|
|
72
26
|
function setUpLocationSync(ngUpgrade, urlType = 'path') {
|
|
73
|
-
|
|
74
|
-
|
|
27
|
+
if (!ngUpgrade.$injector) {
|
|
28
|
+
throw new Error(`
|
|
75
29
|
RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.
|
|
76
30
|
Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.
|
|
77
31
|
`);
|
|
32
|
+
}
|
|
33
|
+
const router = ngUpgrade.injector.get(Router);
|
|
34
|
+
const location = ngUpgrade.injector.get(Location);
|
|
35
|
+
ngUpgrade.$injector.get('$rootScope').$on('$locationChangeStart', (event, newUrl, oldUrl, newState, oldState) => {
|
|
36
|
+
const currentNavigationId = router.getCurrentNavigation()?.id;
|
|
37
|
+
const newStateNavigationId = newState?.navigationId;
|
|
38
|
+
if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let url;
|
|
42
|
+
if (urlType === 'path') {
|
|
43
|
+
url = resolveUrl(newUrl);
|
|
44
|
+
} else if (urlType === 'hash') {
|
|
45
|
+
const hashIdx = newUrl.indexOf('#');
|
|
46
|
+
url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));
|
|
47
|
+
} else {
|
|
48
|
+
throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;
|
|
78
49
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
.get('$rootScope')
|
|
83
|
-
.$on('$locationChangeStart', (event, newUrl, oldUrl, newState, oldState) => {
|
|
84
|
-
// Navigations coming from Angular router have a navigationId state
|
|
85
|
-
// property. Don't trigger Angular router navigation again if it is
|
|
86
|
-
// caused by a URL change from the current Angular router
|
|
87
|
-
// navigation.
|
|
88
|
-
const currentNavigationId = router.getCurrentNavigation()?.id;
|
|
89
|
-
const newStateNavigationId = newState?.navigationId;
|
|
90
|
-
if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
let url;
|
|
94
|
-
if (urlType === 'path') {
|
|
95
|
-
url = resolveUrl(newUrl);
|
|
96
|
-
}
|
|
97
|
-
else if (urlType === 'hash') {
|
|
98
|
-
// Remove the first hash from the URL
|
|
99
|
-
const hashIdx = newUrl.indexOf('#');
|
|
100
|
-
url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;
|
|
104
|
-
}
|
|
105
|
-
const path = location.normalize(url.pathname);
|
|
106
|
-
router.navigateByUrl(path + url.search + url.hash);
|
|
107
|
-
});
|
|
50
|
+
const path = location.normalize(url.pathname);
|
|
51
|
+
router.navigateByUrl(path + url.search + url.hash);
|
|
52
|
+
});
|
|
108
53
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Normalizes and parses a URL.
|
|
111
|
-
*
|
|
112
|
-
* - Normalizing means that a relative URL will be resolved into an absolute URL in the context of
|
|
113
|
-
* the application document.
|
|
114
|
-
* - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related
|
|
115
|
-
* properties are all populated to reflect the normalized URL.
|
|
116
|
-
*
|
|
117
|
-
* While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing
|
|
118
|
-
* happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign
|
|
119
|
-
* `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)
|
|
120
|
-
* We work around that by performing the parsing in a 2nd step by taking a previously normalized URL
|
|
121
|
-
* and assigning it again. This correctly populates all properties.
|
|
122
|
-
*
|
|
123
|
-
* See
|
|
124
|
-
* https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33
|
|
125
|
-
* for more info.
|
|
126
|
-
*/
|
|
127
54
|
let anchor;
|
|
128
55
|
function resolveUrl(url) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
};
|
|
56
|
+
anchor ??= document.createElement('a');
|
|
57
|
+
anchor.setAttribute('href', url);
|
|
58
|
+
anchor.setAttribute('href', anchor.href);
|
|
59
|
+
return {
|
|
60
|
+
pathname: `/${anchor.pathname.replace(/^\//, '')}`,
|
|
61
|
+
search: anchor.search,
|
|
62
|
+
hash: anchor.hash
|
|
63
|
+
};
|
|
138
64
|
}
|
|
139
65
|
|
|
140
66
|
export { RouterUpgradeInitializer, locationSyncBootstrapListener, setUpLocationSync };
|
package/fesm2022/upgrade.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"upgrade.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/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,MAAMC,oBAAoB,GAAGL,QAAQ,EAAEM,YAAY;AACnD,IAAA,IAAID,oBAAoB,KAAKE,SAAS,IAAIF,oBAAoB,KAAKH,mBAAmB,EAAE;AACtF,MAAA;AACF;AAEA,IAAA,IAAIM,GAAG;IACP,IAAIrB,OAAO,KAAK,MAAM,EAAE;AACtBqB,MAAAA,GAAG,GAAGC,UAAU,CAACX,MAAM,CAAC;AAC1B,KAAA,MAAO,IAAIX,OAAO,KAAK,MAAM,EAAE;AAE7B,MAAA,MAAMuB,OAAO,GAAGZ,MAAM,CAACa,OAAO,CAAC,GAAG,CAAC;MACnCH,GAAG,GAAGC,UAAU,CAACX,MAAM,CAACc,SAAS,CAAC,CAAC,EAAEF,OAAO,CAAC,GAAGZ,MAAM,CAACc,SAAS,CAACF,OAAO,GAAG,CAAC,CAAC,CAAC;AAChF,KAAA,MAAO;MACL,MAAM,+CAA+C,GAAGvB,OAAO;AACjE;IACA,MAAM0B,IAAI,GAAGnB,QAAQ,CAACoB,SAAS,CAACN,GAAG,CAACO,QAAQ,CAAC;AAC7CzB,IAAAA,MAAM,CAAC0B,aAAa,CAACH,IAAI,GAAGL,GAAG,CAACS,MAAM,GAAGT,GAAG,CAACU,IAAI,CAAC;AACpD,GAAC,CACF;AACL;AAoBA,IAAIC,MAAqC;AACzC,SAASV,UAAUA,CAACD,GAAW,EAAA;AAC7BW,EAAAA,MAAM,KAAKC,QAAQ,CAACC,aAAa,CAAC,GAAG,CAAC;AAEtCF,EAAAA,MAAM,CAACG,YAAY,CAAC,MAAM,EAAEd,GAAG,CAAC;EAChCW,MAAM,CAACG,YAAY,CAAC,MAAM,EAAEH,MAAM,CAACI,IAAI,CAAC;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.0.0-
|
|
3
|
+
"version": "21.0.0-rc.1",
|
|
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-rc.1",
|
|
28
|
+
"@angular/common": "21.0.0-rc.1",
|
|
29
|
+
"@angular/platform-browser": "21.0.0-rc.1",
|
|
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-rc.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3658,6 +3658,8 @@ type InitialNavigation = 'disabled' | 'enabledBlocking' | 'enabledNonBlocking';
|
|
|
3658
3658
|
/**
|
|
3659
3659
|
* Extra configuration options that can be used with the `withRouterConfig` function.
|
|
3660
3660
|
*
|
|
3661
|
+
* @see [Router configuration options](guide/routing/customizing-route-behavior#router-configuration-options)
|
|
3662
|
+
*
|
|
3661
3663
|
* @publicApi
|
|
3662
3664
|
*/
|
|
3663
3665
|
interface RouterConfigOptions {
|
|
@@ -3681,6 +3683,9 @@ interface RouterConfigOptions {
|
|
|
3681
3683
|
* the browser history rather than simply resetting a portion of the URL.
|
|
3682
3684
|
*
|
|
3683
3685
|
* The default value is `replace` when not set.
|
|
3686
|
+
*
|
|
3687
|
+
* @see [Handle canceled navigations](guide/routing/customizing-route-behavior#handle-canceled-navigations)
|
|
3688
|
+
*
|
|
3684
3689
|
*/
|
|
3685
3690
|
canceledNavigationResolution?: 'replace' | 'computed';
|
|
3686
3691
|
/**
|
|
@@ -3689,6 +3694,8 @@ interface RouterConfigOptions {
|
|
|
3689
3694
|
* If unset, the `Router` will use `'ignore'`.
|
|
3690
3695
|
*
|
|
3691
3696
|
* @see {@link OnSameUrlNavigation}
|
|
3697
|
+
*
|
|
3698
|
+
* @see [React to same-URL navigations](guide/routing/customizing-route-behavior#react-to-same-url-navigations)
|
|
3692
3699
|
*/
|
|
3693
3700
|
onSameUrlNavigation?: OnSameUrlNavigation;
|
|
3694
3701
|
/**
|
|
@@ -3707,6 +3714,8 @@ interface RouterConfigOptions {
|
|
|
3707
3714
|
* matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not
|
|
3708
3715
|
* `a;foo=bar/b`.
|
|
3709
3716
|
*
|
|
3717
|
+
* @see [Control parameter inheritance](guide/routing/customizing-route-behavior#control-parameter-inheritance)
|
|
3718
|
+
*
|
|
3710
3719
|
*/
|
|
3711
3720
|
paramsInheritanceStrategy?: 'emptyOnly' | 'always';
|
|
3712
3721
|
/**
|
|
@@ -3715,6 +3724,9 @@ interface RouterConfigOptions {
|
|
|
3715
3724
|
* Set to 'eager' if prefer to update the URL at the beginning of navigation.
|
|
3716
3725
|
* Updating the URL early allows you to handle a failure of navigation by
|
|
3717
3726
|
* showing an error message with the URL that failed.
|
|
3727
|
+
*
|
|
3728
|
+
* @see [Decide when the URL updates](guide/routing/customizing-route-behavior#decide-when-the-url-updates)
|
|
3729
|
+
*
|
|
3718
3730
|
*/
|
|
3719
3731
|
urlUpdateStrategy?: 'deferred' | 'eager';
|
|
3720
3732
|
/**
|
|
@@ -3728,6 +3740,10 @@ interface RouterConfigOptions {
|
|
|
3728
3740
|
*
|
|
3729
3741
|
* @see {@link Router#createUrlTree}
|
|
3730
3742
|
* @see {@link QueryParamsHandling}
|
|
3743
|
+
*
|
|
3744
|
+
* @see [Choose default query parameter handling](guide/routing/customizing-route-behavior#choose-default-query-parameter-handling)
|
|
3745
|
+
|
|
3746
|
+
*
|
|
3731
3747
|
*/
|
|
3732
3748
|
defaultQueryParamsHandling?: QueryParamsHandling;
|
|
3733
3749
|
/**
|
package/types/router.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-
|
|
2
|
+
* @license Angular v21.0.0-rc.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -336,6 +336,7 @@ declare class RouterPreloader implements OnDestroy {
|
|
|
336
336
|
* }
|
|
337
337
|
* );
|
|
338
338
|
* ```
|
|
339
|
+
* @see [Router](guide/routing)
|
|
339
340
|
*
|
|
340
341
|
* @see {@link RouterFeatures}
|
|
341
342
|
*
|
|
@@ -407,6 +408,32 @@ type InMemoryScrollingFeature = RouterFeature<RouterFeatureKind.InMemoryScrollin
|
|
|
407
408
|
* @returns A set of providers for use with `provideRouter`.
|
|
408
409
|
*/
|
|
409
410
|
declare function withInMemoryScrolling(options?: InMemoryScrollingOptions): InMemoryScrollingFeature;
|
|
411
|
+
/**
|
|
412
|
+
* Enables the use of the browser's `History` API for navigation.
|
|
413
|
+
*
|
|
414
|
+
* @description
|
|
415
|
+
* This function provides a `Location` strategy that uses the browser's `History` API.
|
|
416
|
+
* It is required when using features that rely on `history.state`. For example, the
|
|
417
|
+
* `state` object in `NavigationExtras` is passed to `history.pushState` or
|
|
418
|
+
* `history.replaceState`.
|
|
419
|
+
*
|
|
420
|
+
* @usageNotes
|
|
421
|
+
*
|
|
422
|
+
* ```typescript
|
|
423
|
+
* const appRoutes: Routes = [
|
|
424
|
+
* { path: 'page', component: PageComponent },
|
|
425
|
+
* ];
|
|
426
|
+
*
|
|
427
|
+
* bootstrapApplication(AppComponent, {
|
|
428
|
+
* providers: [
|
|
429
|
+
* provideRouter(appRoutes, withPlatformNavigation())
|
|
430
|
+
* ]
|
|
431
|
+
* });
|
|
432
|
+
* ```
|
|
433
|
+
*
|
|
434
|
+
* @returns A `RouterFeature` that enables the platform navigation.
|
|
435
|
+
*/
|
|
436
|
+
declare function withPlatformNavigation(): RouterFeature<RouterFeatureKind.InMemoryScrollingFeature>;
|
|
410
437
|
/**
|
|
411
438
|
* A type alias for providers returned by `withEnabledBlockingInitialNavigation` for use with
|
|
412
439
|
* `provideRouter`.
|
|
@@ -901,5 +928,5 @@ declare function afterNextNavigation(router: {
|
|
|
901
928
|
*/
|
|
902
929
|
declare function provideSometimesSyncRecognize(): EnvironmentProviders;
|
|
903
930
|
|
|
904
|
-
export { ActivatedRoute, ActivatedRouteSnapshot, CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanMatch, CanMatchFn, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, Event, InMemoryScrollingOptions, NavigationError, NoPreloading, OutletContext, Params, PreloadAllModules, PreloadingStrategy, ROUTES, RedirectCommand, Resolve, ResolveFn, Route, Router, RouterConfigOptions, RouterOutletContract, RouterPreloader, RouterStateSnapshot, Routes, TitleStrategy, UrlHandlingStrategy, UrlTree, VERSION, createUrlTreeFromSnapshot, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren, provideSometimesSyncRecognize as ɵprovideSometimesSyncRecognize };
|
|
931
|
+
export { ActivatedRoute, ActivatedRouteSnapshot, CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanMatch, CanMatchFn, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, Event, InMemoryScrollingOptions, NavigationError, NoPreloading, OutletContext, Params, PreloadAllModules, PreloadingStrategy, ROUTES, RedirectCommand, Resolve, ResolveFn, Route, Router, RouterConfigOptions, RouterOutletContract, RouterPreloader, RouterStateSnapshot, Routes, TitleStrategy, UrlHandlingStrategy, UrlTree, VERSION, createUrlTreeFromSnapshot, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren, provideSometimesSyncRecognize as ɵprovideSometimesSyncRecognize, withPlatformNavigation as ɵwithPlatformNavigation };
|
|
905
932
|
export type { ComponentInputBindingFeature, DebugTracingFeature, DisabledInitialNavigationFeature, EnabledBlockingInitialNavigationFeature, InMemoryScrollingFeature, InitialNavigationFeature, NavigationErrorHandlerFeature, PreloadingFeature, RouterConfigurationFeature, RouterFeature, RouterFeatures, RouterHashLocationFeature, ViewTransitionInfo, ViewTransitionsFeature, ViewTransitionsFeatureOptions };
|
package/types/testing.d.ts
CHANGED
package/types/upgrade.d.ts
CHANGED