@angular/router 20.2.2 → 21.0.0-next.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.mjs +2 -2
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/router2.mjs +6 -5
- package/fesm2022/router2.mjs.map +1 -1
- package/fesm2022/router_module.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/upgrade.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +4 -4
- package/router_module.d.d.ts +3 -3
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
package/fesm2022/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v21.0.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -81,7 +81,7 @@ function mapToResolve(provider) {
|
|
|
81
81
|
/**
|
|
82
82
|
* @publicApi
|
|
83
83
|
*/
|
|
84
|
-
const VERSION = new Version('
|
|
84
|
+
const VERSION = new Version('21.0.0-next.1');
|
|
85
85
|
|
|
86
86
|
export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };
|
|
87
87
|
//# 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 = new Version('
|
|
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 = new Version('21.0.0-next.1');\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBA;;;;;;;;AAQG;AACG,SAAU,aAAa,CAAC,SAAgC,EAAA;IAC5D,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,CACzC;AACH;AAEA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAAC,SAAmC,EAAA;IAClE,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,CAC5C;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,qBAAqB,CACnC,SAAwC,EAAA;IAExC,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,CACjD;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAChC,SAAwC,EAAA;IAExC,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,CAC9C;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,YAAY,CAAI,QAA0B,EAAA;AACxD,IAAA,OAAO,CAAC,GAAG,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;AAC3D;;AC/FA;;;;AAIG;AAIH;;AAEG;MACU,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
|
package/fesm2022/router2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular
|
|
2
|
+
* @license Angular v21.0.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4678,7 +4678,7 @@ class NavigationTransitions {
|
|
|
4678
4678
|
// Some G3 targets expect the navigation object to be mutated (and not getting a new reference on changes).
|
|
4679
4679
|
currentNavigation = signal(null, ...(ngDevMode ? [{ debugName: "currentNavigation", equal: () => false }] : [{ equal: () => false }]));
|
|
4680
4680
|
currentTransition = null;
|
|
4681
|
-
lastSuccessfulNavigation = null;
|
|
4681
|
+
lastSuccessfulNavigation = signal(null, ...(ngDevMode ? [{ debugName: "lastSuccessfulNavigation" }] : []));
|
|
4682
4682
|
/**
|
|
4683
4683
|
* These events are used to communicate back to the Router about the state of the transition. The
|
|
4684
4684
|
* Router wants to respond to these events in various ways. Because the `NavigationTransition`
|
|
@@ -4766,6 +4766,7 @@ class NavigationTransitions {
|
|
|
4766
4766
|
return EMPTY;
|
|
4767
4767
|
}
|
|
4768
4768
|
this.currentTransition = overallTransitionState;
|
|
4769
|
+
const lastSuccessfulNavigation = this.lastSuccessfulNavigation();
|
|
4769
4770
|
// Store the Navigation object
|
|
4770
4771
|
this.currentNavigation.set({
|
|
4771
4772
|
id: t.id,
|
|
@@ -4776,10 +4777,10 @@ class NavigationTransitions {
|
|
|
4776
4777
|
: t.extras.browserUrl,
|
|
4777
4778
|
trigger: t.source,
|
|
4778
4779
|
extras: t.extras,
|
|
4779
|
-
previousNavigation: !
|
|
4780
|
+
previousNavigation: !lastSuccessfulNavigation
|
|
4780
4781
|
? null
|
|
4781
4782
|
: {
|
|
4782
|
-
...
|
|
4783
|
+
...lastSuccessfulNavigation,
|
|
4783
4784
|
previousNavigation: null,
|
|
4784
4785
|
},
|
|
4785
4786
|
abort: () => t.abortController.abort(),
|
|
@@ -4956,7 +4957,7 @@ class NavigationTransitions {
|
|
|
4956
4957
|
}))), tap({
|
|
4957
4958
|
next: (t) => {
|
|
4958
4959
|
completedOrAborted = true;
|
|
4959
|
-
this.lastSuccessfulNavigation
|
|
4960
|
+
this.lastSuccessfulNavigation.set(untracked(this.currentNavigation));
|
|
4960
4961
|
this.events.next(new NavigationEnd(t.id, this.urlSerializer.serialize(t.extractedUrl), this.urlSerializer.serialize(t.urlAfterRedirects)));
|
|
4961
4962
|
this.titleStrategy?.updateTitle(t.targetRouterState.snapshot);
|
|
4962
4963
|
t.resolve(true);
|