@angular/router 15.0.0 → 15.1.0-next.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/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/directives/router_link.mjs +3 -3
- package/esm2020/src/directives/router_link_active.mjs +3 -3
- package/esm2020/src/directives/router_outlet.mjs +5 -5
- package/esm2020/src/events.mjs +34 -1
- package/esm2020/src/index.mjs +2 -2
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/navigation_transition.mjs +328 -0
- package/esm2020/src/operators/activate_routes.mjs +1 -1
- package/esm2020/src/operators/apply_redirects.mjs +1 -1
- package/esm2020/src/operators/check_guards.mjs +1 -1
- package/esm2020/src/operators/recognize.mjs +1 -1
- package/esm2020/src/operators/resolve_data.mjs +1 -1
- package/esm2020/src/page_title_strategy.mjs +6 -6
- package/esm2020/src/private_export.mjs +1 -1
- package/esm2020/src/provide_router.mjs +6 -13
- package/esm2020/src/route_reuse_strategy.mjs +15 -1
- package/esm2020/src/router.mjs +100 -347
- package/esm2020/src/router_config_loader.mjs +3 -3
- package/esm2020/src/router_module.mjs +4 -4
- package/esm2020/src/router_outlet_context.mjs +3 -3
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/url_handling_strategy.mjs +15 -1
- package/esm2020/src/url_tree.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +8 -54
- package/fesm2015/router.mjs +524 -403
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +9 -55
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +538 -412
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +9 -55
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +113 -62
- package/package.json +4 -4
- package/testing/index.d.ts +2 -7
- package/upgrade/index.d.ts +1 -1
package/fesm2020/testing.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0
|
|
2
|
+
* @license Angular v15.1.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Location } from '@angular/common';
|
|
8
7
|
import { provideLocationMocks } from '@angular/common/testing';
|
|
9
8
|
import * as i0 from '@angular/core';
|
|
10
|
-
import {
|
|
11
|
-
import { Router, ɵflatten, ɵassignExtraOptionsToRouter, ROUTES, ROUTER_CONFIGURATION, RouterModule, ɵROUTER_PROVIDERS,
|
|
9
|
+
import { NgModule } from '@angular/core';
|
|
10
|
+
import { Router, ɵflatten, ɵassignExtraOptionsToRouter, ROUTES, ROUTER_CONFIGURATION, RouterModule, ɵROUTER_PROVIDERS, ɵwithPreloading, NoPreloading } from '@angular/router';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* @license
|
|
@@ -20,29 +19,16 @@ import { Router, ɵflatten, ɵassignExtraOptionsToRouter, ROUTES, ROUTER_CONFIGU
|
|
|
20
19
|
// This file exists to easily patch the SpyNgModuleFactoryLoader into g3
|
|
21
20
|
const EXTRA_ROUTER_TESTING_PROVIDERS = [];
|
|
22
21
|
|
|
23
|
-
/**
|
|
24
|
-
* @license
|
|
25
|
-
* Copyright Google LLC All Rights Reserved.
|
|
26
|
-
*
|
|
27
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
28
|
-
* found in the LICENSE file at https://angular.io/license
|
|
29
|
-
*/
|
|
30
22
|
function isUrlHandlingStrategy(opts) {
|
|
31
23
|
// This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at
|
|
32
24
|
// runtime.
|
|
33
25
|
return 'shouldProcessUrl' in opts;
|
|
34
26
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Router setup factory function used for testing. Only used internally to keep the factory that's
|
|
37
|
-
* marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).
|
|
38
|
-
*/
|
|
39
|
-
function setupTestingRouterInternal(urlSerializer, contexts, location, compiler, injector, routes, titleStrategy, opts, urlHandlingStrategy, routeReuseStrategy) {
|
|
40
|
-
return setupTestingRouter(urlSerializer, contexts, location, compiler, injector, routes, opts, urlHandlingStrategy, routeReuseStrategy, titleStrategy);
|
|
41
|
-
}
|
|
42
27
|
/**
|
|
43
28
|
* Router setup factory function used for testing.
|
|
44
29
|
*
|
|
45
30
|
* @publicApi
|
|
31
|
+
* @deprecated Use `provideRouter` or `RouterTestingModule` instead.
|
|
46
32
|
*/
|
|
47
33
|
function setupTestingRouter(urlSerializer, contexts, location, compiler, injector, routes, opts, urlHandlingStrategy, routeReuseStrategy, titleStrategy) {
|
|
48
34
|
const router = new Router(null, urlSerializer, contexts, location, injector, compiler, ɵflatten(routes));
|
|
@@ -101,32 +87,16 @@ class RouterTestingModule {
|
|
|
101
87
|
};
|
|
102
88
|
}
|
|
103
89
|
}
|
|
104
|
-
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
105
|
-
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
|
|
106
|
-
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, providers: [
|
|
90
|
+
RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
91
|
+
RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
|
|
92
|
+
RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterTestingModule, providers: [
|
|
107
93
|
ɵROUTER_PROVIDERS,
|
|
108
94
|
EXTRA_ROUTER_TESTING_PROVIDERS,
|
|
109
95
|
provideLocationMocks(),
|
|
110
|
-
{
|
|
111
|
-
provide: Router,
|
|
112
|
-
useFactory: setupTestingRouterInternal,
|
|
113
|
-
deps: [
|
|
114
|
-
UrlSerializer,
|
|
115
|
-
ChildrenOutletContexts,
|
|
116
|
-
Location,
|
|
117
|
-
Compiler,
|
|
118
|
-
Injector,
|
|
119
|
-
ROUTES,
|
|
120
|
-
TitleStrategy,
|
|
121
|
-
ROUTER_CONFIGURATION,
|
|
122
|
-
[UrlHandlingStrategy, new Optional()],
|
|
123
|
-
[RouteReuseStrategy, new Optional()],
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
96
|
ɵwithPreloading(NoPreloading).ɵproviders,
|
|
127
97
|
{ provide: ROUTES, multi: true, useValue: [] },
|
|
128
98
|
], imports: [RouterModule] });
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: RouterTestingModule, decorators: [{
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0-next.0", ngImport: i0, type: RouterTestingModule, decorators: [{
|
|
130
100
|
type: NgModule,
|
|
131
101
|
args: [{
|
|
132
102
|
exports: [RouterModule],
|
|
@@ -134,22 +104,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImpor
|
|
|
134
104
|
ɵROUTER_PROVIDERS,
|
|
135
105
|
EXTRA_ROUTER_TESTING_PROVIDERS,
|
|
136
106
|
provideLocationMocks(),
|
|
137
|
-
{
|
|
138
|
-
provide: Router,
|
|
139
|
-
useFactory: setupTestingRouterInternal,
|
|
140
|
-
deps: [
|
|
141
|
-
UrlSerializer,
|
|
142
|
-
ChildrenOutletContexts,
|
|
143
|
-
Location,
|
|
144
|
-
Compiler,
|
|
145
|
-
Injector,
|
|
146
|
-
ROUTES,
|
|
147
|
-
TitleStrategy,
|
|
148
|
-
ROUTER_CONFIGURATION,
|
|
149
|
-
[UrlHandlingStrategy, new Optional()],
|
|
150
|
-
[RouteReuseStrategy, new Optional()],
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
107
|
ɵwithPreloading(NoPreloading).ɵproviders,
|
|
154
108
|
{ provide: ROUTES, multi: true, useValue: [] },
|
|
155
109
|
]
|
|
@@ -195,5 +149,5 @@ var spy_ng_module_factory_loader = {};
|
|
|
195
149
|
* Generated bundle index. Do not edit.
|
|
196
150
|
*/
|
|
197
151
|
|
|
198
|
-
export { RouterTestingModule, setupTestingRouter
|
|
152
|
+
export { RouterTestingModule, setupTestingRouter };
|
|
199
153
|
//# sourceMappingURL=testing.mjs.map
|
package/fesm2020/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../packages/router/testing/src/extra_router_testing_providers.ts","../../../../../../packages/router/testing/src/router_testing_module.ts","../../../../../../packages/router/testing/src/spy_ng_module_factory_loader.ts","../../../../../../packages/router/testing/src/testing.ts","../../../../../../packages/router/testing/public_api.ts","../../../../../../packages/router/testing/index.ts","../../../../../../packages/router/testing/testing.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.io/license\n */\n\n// This file exists to easily patch the SpyNgModuleFactoryLoader into g3\nexport const EXTRA_ROUTER_TESTING_PROVIDERS = [];\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.io/license\n */\n\nimport {Location} from '@angular/common';\nimport {provideLocationMocks} from '@angular/common/testing';\nimport {Compiler, Injector, ModuleWithProviders, NgModule, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, Route, Router, ROUTER_CONFIGURATION, RouteReuseStrategy, RouterModule, ROUTES, Routes, TitleStrategy, UrlHandlingStrategy, UrlSerializer, ɵassignExtraOptionsToRouter as assignExtraOptionsToRouter, ɵflatten as flatten, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS, ɵwithPreloading as withPreloading} from '@angular/router';\n\nimport {EXTRA_ROUTER_TESTING_PROVIDERS} from './extra_router_testing_providers';\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions|\n UrlHandlingStrategy): opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing. Only used internally to keep the factory that's\n * marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).\n */\nexport function setupTestingRouterInternal(\n urlSerializer: UrlSerializer,\n contexts: ChildrenOutletContexts,\n location: Location,\n compiler: Compiler,\n injector: Injector,\n routes: Route[][],\n titleStrategy: TitleStrategy,\n opts?: ExtraOptions|UrlHandlingStrategy,\n urlHandlingStrategy?: UrlHandlingStrategy,\n routeReuseStrategy?: RouteReuseStrategy,\n) {\n return setupTestingRouter(\n urlSerializer, contexts, location, compiler, injector, routes, opts, urlHandlingStrategy,\n routeReuseStrategy, titleStrategy);\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions|UrlHandlingStrategy|null, urlHandlingStrategy?: UrlHandlingStrategy,\n routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy) {\n const router =\n new Router(null!, urlSerializer, contexts, location, injector, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n assignExtraOptionsToRouter(opts, router);\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n\n router.titleStrategy = titleStrategy;\n\n return router;\n}\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 * ```\n * beforeEach(() => {\n * TestBed.configureTestingModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS,\n EXTRA_ROUTER_TESTING_PROVIDERS,\n provideLocationMocks(),\n {\n provide: Router,\n useFactory: setupTestingRouterInternal,\n deps: [\n UrlSerializer,\n ChildrenOutletContexts,\n Location,\n Compiler,\n Injector,\n ROUTES,\n TitleStrategy,\n ROUTER_CONFIGURATION,\n [UrlHandlingStrategy, new Optional()],\n [RouteReuseStrategy, new Optional()],\n ]\n },\n withPreloading(NoPreloading).ɵproviders,\n {provide: ROUTES, multi: true, useValue: []},\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, 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.io/license\n */\n\n// This file exists for easily patching SpyNgModuleFactoryLoader in g3\nexport default {};\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.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router/testing package.\n */\nexport * from './router_testing_module';\nexport * from './spy_ng_module_factory_loader';\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.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\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.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","assignExtraOptionsToRouter","ROUTER_PROVIDERS","withPreloading"],"mappings":";;;;;;;;;;;;AAAA;;;;;;AAMG;AAEH;AACO,MAAM,8BAA8B,GAAG,EAAE;;ACThD;;;;;;AAMG;AASH,SAAS,qBAAqB,CAAC,IACmB,EAAA;;;IAGhD,OAAO,kBAAkB,IAAI,IAAI,CAAC;AACpC,CAAC;AAED;;;AAGG;AACG,SAAU,0BAA0B,CACtC,aAA4B,EAC5B,QAAgC,EAChC,QAAkB,EAClB,QAAkB,EAClB,QAAkB,EAClB,MAAiB,EACjB,aAA4B,EAC5B,IAAuC,EACvC,mBAAyC,EACzC,kBAAuC,EAAA;IAEzC,OAAO,kBAAkB,CACrB,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EACxF,kBAAkB,EAAE,aAAa,C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AC,YAAY,CAAC;AACvB,oBAAA,SAAS,EAAE;wBACTD,iBAAgB;wBAChB,8BAA8B;AAC9B,wBAAA,oBAAoB,EAAE;AACtB,wBAAA;AACE,4BAAA,OAAO,EAAE,MAAM;AACf,4BAAA,UAAU,EAAE,0BAA0B;AACtC,4BAAA,IAAI,EAAE;gCACJ,aAAa;gCACb,sBAAsB;gCACtB,QAAQ;gCACR,QAAQ;gCACR,QAAQ;gCACR,MAAM;gCACN,aAAa;gCACb,oBAAoB;AACpB,gCAAA,CAAC,mBAAmB,EAAE,IAAI,QAAQ,EAAE,CAAC;AACrC,gCAAA,CAAC,kBAAkB,EAAE,IAAI,QAAQ,EAAE,CAAC;AACrC,6BAAA;AACF,yBAAA;AACD,wBAAAC,eAAc,CAAC,YAAY,CAAC,CAAC,UAAU;wBACvC,EAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAC;AAC7C,qBAAA;AACF,iBAAA,CAAA;;;AChID;;;;;;AAMG;AAEH;AACA,mCAAe,EAAE;;ACTjB;;;;;;AAMG;;ACNH;;;;;;AAMG;AASH;;ACfA;;;;;;AAMG;;ACNH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../packages/router/testing/src/extra_router_testing_providers.ts","../../../../../../packages/router/testing/src/router_testing_module.ts","../../../../../../packages/router/testing/src/spy_ng_module_factory_loader.ts","../../../../../../packages/router/testing/src/testing.ts","../../../../../../packages/router/testing/public_api.ts","../../../../../../packages/router/testing/index.ts","../../../../../../packages/router/testing/testing.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.io/license\n */\n\n// This file exists to easily patch the SpyNgModuleFactoryLoader into g3\nexport const EXTRA_ROUTER_TESTING_PROVIDERS = [];\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.io/license\n */\n\nimport {Location} from '@angular/common';\nimport {provideLocationMocks} from '@angular/common/testing';\nimport {Compiler, Injector, ModuleWithProviders, NgModule, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, Route, Router, ROUTER_CONFIGURATION, RouteReuseStrategy, RouterModule, ROUTES, Routes, TitleStrategy, UrlHandlingStrategy, UrlSerializer, ɵassignExtraOptionsToRouter as assignExtraOptionsToRouter, ɵflatten as flatten, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS, ɵwithPreloading as withPreloading} from '@angular/router';\n\nimport {EXTRA_ROUTER_TESTING_PROVIDERS} from './extra_router_testing_providers';\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions|\n UrlHandlingStrategy): opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n * @deprecated Use `provideRouter` or `RouterTestingModule` instead.\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions|UrlHandlingStrategy|null, urlHandlingStrategy?: UrlHandlingStrategy,\n routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy) {\n const router =\n new Router(null!, urlSerializer, contexts, location, injector, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n assignExtraOptionsToRouter(opts, router);\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n\n if (routeReuseStrategy) {\n router.routeReuseStrategy = routeReuseStrategy;\n }\n\n router.titleStrategy = titleStrategy;\n\n return router;\n}\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 * ```\n * beforeEach(() => {\n * TestBed.configureTestingModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS,\n EXTRA_ROUTER_TESTING_PROVIDERS,\n provideLocationMocks(),\n withPreloading(NoPreloading).ɵproviders,\n {provide: ROUTES, multi: true, useValue: []},\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, 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.io/license\n */\n\n// This file exists for easily patching SpyNgModuleFactoryLoader in g3\nexport default {};\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.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router/testing package.\n */\nexport * from './router_testing_module';\nexport * from './spy_ng_module_factory_loader';\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.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\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.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","assignExtraOptionsToRouter","ROUTER_PROVIDERS","withPreloading"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAMG;AAEH;AACO,MAAM,8BAA8B,GAAG,EAAE;;ACMhD,SAAS,qBAAqB,CAAC,IACmB,EAAA;;;IAGhD,OAAO,kBAAkB,IAAI,IAAI,CAAC;AACpC,CAAC;AAED;;;;;AAKG;AACG,SAAU,kBAAkB,CAC9B,aAA4B,EAAE,QAAgC,EAAE,QAAkB,EAClF,QAAkB,EAAE,QAAkB,EAAE,MAAiB,EACzD,IAA4C,EAAE,mBAAyC,EACvF,kBAAuC,EAAE,aAA6B,EAAA;IACxE,MAAM,MAAM,GACR,IAAI,MAAM,CAAC,IAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAEA,QAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9F,IAAA,IAAI,IAAI,EAAE;;AAER,QAAA,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE;AAC/B,YAAA,MAAM,CAAC,mBAAmB,GAAG,IAAI,CAAC;AACnC,SAAA;AAAM,aAAA;;AAEL,YAAAC,2BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,SAAA;AACF,KAAA;AAED,IAAA,IAAI,mBAAmB,EAAE;AACvB,QAAA,MAAM,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AAClD,KAAA;AAED,IAAA,IAAI,kBAAkB,EAAE;AACtB,QAAA,MAAM,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AAChD,KAAA;AAED,IAAA,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;AAErC,IAAA,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;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vB,oBAAA,SAAS,EAAE;wBACTD,iBAAgB;wBAChB,8BAA8B;AAC9B,wBAAA,oBAAoB,EAAE;AACtB,wBAAAC,eAAc,CAAC,YAAY,CAAC,CAAC,UAAU;wBACvC,EAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAC;AAC7C,qBAAA;AACF,iBAAA,CAAA;;;AC5FD;;;;;;AAMG;AAEH;AACA,mCAAe,EAAE;;ACTjB;;;;;;AAMG;;ACNH;;;;;;AAMG;AASH;;ACfA;;;;;;AAMG;;ACNH;;AAEG;;;;"}
|
package/fesm2020/upgrade.mjs
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0
|
|
2
|
+
* @license Angular v15.1.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -498,7 +498,7 @@ export declare type CanActivateFn = (route: ActivatedRouteSnapshot, state: Route
|
|
|
498
498
|
* @publicApi
|
|
499
499
|
*/
|
|
500
500
|
export declare interface CanDeactivate<T> {
|
|
501
|
-
canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState
|
|
501
|
+
canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
/**
|
|
@@ -508,7 +508,7 @@ export declare interface CanDeactivate<T> {
|
|
|
508
508
|
* @see `CanDeactivate`
|
|
509
509
|
* @see `Route`
|
|
510
510
|
*/
|
|
511
|
-
export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState
|
|
511
|
+
export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
512
512
|
|
|
513
513
|
/**
|
|
514
514
|
* @description
|
|
@@ -988,7 +988,7 @@ declare type ErrorHandler = (error: any) => any;
|
|
|
988
988
|
*
|
|
989
989
|
* @publicApi
|
|
990
990
|
*/
|
|
991
|
-
declare type Event_2 = RouterEvent | NavigationStart | NavigationEnd | NavigationCancel | NavigationError | RoutesRecognized | GuardsCheckStart | GuardsCheckEnd | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll | ResolveStart | ResolveEnd;
|
|
991
|
+
declare type Event_2 = RouterEvent | NavigationStart | NavigationEnd | NavigationCancel | NavigationError | RoutesRecognized | GuardsCheckStart | GuardsCheckEnd | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll | ResolveStart | ResolveEnd | NavigationSkipped;
|
|
992
992
|
export { Event_2 as Event }
|
|
993
993
|
|
|
994
994
|
/**
|
|
@@ -1012,7 +1012,8 @@ export declare const enum EventType {
|
|
|
1012
1012
|
ChildActivationEnd = 12,
|
|
1013
1013
|
ActivationStart = 13,
|
|
1014
1014
|
ActivationEnd = 14,
|
|
1015
|
-
Scroll = 15
|
|
1015
|
+
Scroll = 15,
|
|
1016
|
+
NavigationSkipped = 16
|
|
1016
1017
|
}
|
|
1017
1018
|
|
|
1018
1019
|
/**
|
|
@@ -1622,6 +1623,65 @@ export declare class NavigationError extends RouterEvent {
|
|
|
1622
1623
|
export declare interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {
|
|
1623
1624
|
}
|
|
1624
1625
|
|
|
1626
|
+
/**
|
|
1627
|
+
* An event triggered when a navigation is skipped.
|
|
1628
|
+
* This can happen for a couple reasons including onSameUrlHandling
|
|
1629
|
+
* is set to `ignore` and the navigation URL is not different than the
|
|
1630
|
+
* current state.
|
|
1631
|
+
*
|
|
1632
|
+
* @publicApi
|
|
1633
|
+
*/
|
|
1634
|
+
export declare class NavigationSkipped extends RouterEvent {
|
|
1635
|
+
/**
|
|
1636
|
+
* A description of why the navigation was skipped. For debug purposes only. Use `code`
|
|
1637
|
+
* instead for a stable skipped reason that can be used in production.
|
|
1638
|
+
*/
|
|
1639
|
+
reason: string;
|
|
1640
|
+
/**
|
|
1641
|
+
* A code to indicate why the navigation was skipped. This code is stable for
|
|
1642
|
+
* the reason and can be relied on whereas the `reason` string could change and should not be
|
|
1643
|
+
* used in production.
|
|
1644
|
+
*/
|
|
1645
|
+
readonly code?: NavigationSkippedCode | undefined;
|
|
1646
|
+
readonly type = EventType.NavigationSkipped;
|
|
1647
|
+
constructor(
|
|
1648
|
+
/** @docsNotRequired */
|
|
1649
|
+
id: number,
|
|
1650
|
+
/** @docsNotRequired */
|
|
1651
|
+
url: string,
|
|
1652
|
+
/**
|
|
1653
|
+
* A description of why the navigation was skipped. For debug purposes only. Use `code`
|
|
1654
|
+
* instead for a stable skipped reason that can be used in production.
|
|
1655
|
+
*/
|
|
1656
|
+
reason: string,
|
|
1657
|
+
/**
|
|
1658
|
+
* A code to indicate why the navigation was skipped. This code is stable for
|
|
1659
|
+
* the reason and can be relied on whereas the `reason` string could change and should not be
|
|
1660
|
+
* used in production.
|
|
1661
|
+
*/
|
|
1662
|
+
code?: NavigationSkippedCode | undefined);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* A code for the `NavigationSkipped` event of the `Router` to indicate the
|
|
1667
|
+
* reason a navigation was skipped.
|
|
1668
|
+
*
|
|
1669
|
+
* @publicApi
|
|
1670
|
+
*/
|
|
1671
|
+
export declare const enum NavigationSkippedCode {
|
|
1672
|
+
/**
|
|
1673
|
+
* A navigation was skipped because the navigation URL was the same as the current Router URL.
|
|
1674
|
+
*/
|
|
1675
|
+
IgnoredSameUrlNavigation = 0,
|
|
1676
|
+
/**
|
|
1677
|
+
* A navigation was skipped because the configured `UrlHandlingStrategy` return `false` for both
|
|
1678
|
+
* the current Router URL and the target of the navigation.
|
|
1679
|
+
*
|
|
1680
|
+
* @see UrlHandlingStrategy
|
|
1681
|
+
*/
|
|
1682
|
+
IgnoredByUrlHandlingStrategy = 1
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1625
1685
|
/**
|
|
1626
1686
|
* An event triggered when a navigation starts.
|
|
1627
1687
|
*
|
|
@@ -2494,55 +2554,10 @@ export declare class RouteConfigLoadStart {
|
|
|
2494
2554
|
* @publicApi
|
|
2495
2555
|
*/
|
|
2496
2556
|
export declare class Router {
|
|
2497
|
-
private rootComponentType;
|
|
2498
|
-
private urlSerializer;
|
|
2499
|
-
private rootContexts;
|
|
2500
|
-
private location;
|
|
2501
2557
|
config: Routes;
|
|
2502
|
-
/**
|
|
2503
|
-
* Represents the activated `UrlTree` that the `Router` is configured to handle (through
|
|
2504
|
-
* `UrlHandlingStrategy`). That is, after we find the route config tree that we're going to
|
|
2505
|
-
* activate, run guards, and are just about to activate the route, we set the currentUrlTree.
|
|
2506
|
-
*
|
|
2507
|
-
* This should match the `browserUrlTree` when a navigation succeeds. If the
|
|
2508
|
-
* `UrlHandlingStrategy.shouldProcessUrl` is `false`, only the `browserUrlTree` is updated.
|
|
2509
|
-
*/
|
|
2510
|
-
private currentUrlTree;
|
|
2511
|
-
/**
|
|
2512
|
-
* Meant to represent the entire browser url after a successful navigation. In the life of a
|
|
2513
|
-
* navigation transition:
|
|
2514
|
-
* 1. The rawUrl represents the full URL that's being navigated to
|
|
2515
|
-
* 2. We apply redirects, which might only apply to _part_ of the URL (due to
|
|
2516
|
-
* `UrlHandlingStrategy`).
|
|
2517
|
-
* 3. Right before activation (because we assume activation will succeed), we update the
|
|
2518
|
-
* rawUrlTree to be a combination of the urlAfterRedirects (again, this might only apply to part
|
|
2519
|
-
* of the initial url) and the rawUrl of the transition (which was the original navigation url in
|
|
2520
|
-
* its full form).
|
|
2521
|
-
*/
|
|
2522
|
-
private rawUrlTree;
|
|
2523
|
-
/**
|
|
2524
|
-
* Meant to represent the part of the browser url that the `Router` is set up to handle (via the
|
|
2525
|
-
* `UrlHandlingStrategy`). This value is updated immediately after the browser url is updated (or
|
|
2526
|
-
* the browser url update is skipped via `skipLocationChange`). With that, note that
|
|
2527
|
-
* `browserUrlTree` _may not_ reflect the actual browser URL for two reasons:
|
|
2528
|
-
*
|
|
2529
|
-
* 1. `UrlHandlingStrategy` only handles part of the URL
|
|
2530
|
-
* 2. `skipLocationChange` does not update the browser url.
|
|
2531
|
-
*
|
|
2532
|
-
* So to reiterate, `browserUrlTree` only represents the Router's internal understanding of the
|
|
2533
|
-
* current route, either before guards with `urlUpdateStrategy === 'eager'` or right before
|
|
2534
|
-
* activation with `'deferred'`.
|
|
2535
|
-
*
|
|
2536
|
-
* This should match the `currentUrlTree` when the navigation succeeds.
|
|
2537
|
-
*/
|
|
2538
|
-
private browserUrlTree;
|
|
2539
|
-
private readonly transitions;
|
|
2540
2558
|
private navigations;
|
|
2541
|
-
private lastSuccessfulNavigation;
|
|
2542
|
-
private currentNavigation;
|
|
2543
2559
|
private disposed;
|
|
2544
2560
|
private locationSubscription?;
|
|
2545
|
-
private navigationId;
|
|
2546
2561
|
/**
|
|
2547
2562
|
* The id of the currently active page in the router.
|
|
2548
2563
|
* Updated to the transition's target id on a successful navigation.
|
|
@@ -2558,8 +2573,6 @@ export declare class Router {
|
|
|
2558
2573
|
* page id in the browser history is 1 more than the previous entry.
|
|
2559
2574
|
*/
|
|
2560
2575
|
private get browserPageId();
|
|
2561
|
-
private configLoader;
|
|
2562
|
-
private ngModule;
|
|
2563
2576
|
private console;
|
|
2564
2577
|
private isNgZoneEnabled;
|
|
2565
2578
|
/**
|
|
@@ -2572,6 +2585,8 @@ export declare class Router {
|
|
|
2572
2585
|
readonly routerState: RouterState;
|
|
2573
2586
|
/**
|
|
2574
2587
|
* A handler for navigation errors in this NgModule.
|
|
2588
|
+
*
|
|
2589
|
+
* @deprecated Subscribe to the `Router` events and watch for `NavigationError` instead.
|
|
2575
2590
|
*/
|
|
2576
2591
|
errorHandler: ErrorHandler;
|
|
2577
2592
|
/**
|
|
@@ -2579,6 +2594,10 @@ export declare class Router {
|
|
|
2579
2594
|
* when `url` contains an invalid character.
|
|
2580
2595
|
* The most common case is a `%` sign
|
|
2581
2596
|
* that's not encoded and is not part of a percent encoded sequence.
|
|
2597
|
+
*
|
|
2598
|
+
* @deprecated Configure this through `RouterModule.forRoot` instead:
|
|
2599
|
+
* `RouterModule.forRoot(routes, {malformedUriErrorHandler: myHandler})`
|
|
2600
|
+
* @see `RouterModule`
|
|
2582
2601
|
*/
|
|
2583
2602
|
malformedUriErrorHandler: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
|
|
2584
2603
|
/**
|
|
@@ -2590,14 +2609,23 @@ export declare class Router {
|
|
|
2590
2609
|
/**
|
|
2591
2610
|
* A strategy for extracting and merging URLs.
|
|
2592
2611
|
* Used for AngularJS to Angular migrations.
|
|
2612
|
+
*
|
|
2613
|
+
* @deprecated Configure using `providers` instead:
|
|
2614
|
+
* `{provide: UrlHandlingStrategy, useClass: MyStrategy}`.
|
|
2593
2615
|
*/
|
|
2594
2616
|
urlHandlingStrategy: UrlHandlingStrategy;
|
|
2595
2617
|
/**
|
|
2596
2618
|
* A strategy for re-using routes.
|
|
2619
|
+
*
|
|
2620
|
+
* @deprecated Configure using `providers` instead:
|
|
2621
|
+
* `{provide: RouteReuseStrategy, useClass: MyStrategy}`.
|
|
2597
2622
|
*/
|
|
2598
2623
|
routeReuseStrategy: RouteReuseStrategy;
|
|
2599
2624
|
/**
|
|
2600
2625
|
* A strategy for setting the title based on the `routerState`.
|
|
2626
|
+
*
|
|
2627
|
+
* @deprecated Configure using `providers` instead:
|
|
2628
|
+
* `{provide: TitleStrategy, useClass: MyStrategy}`.
|
|
2601
2629
|
*/
|
|
2602
2630
|
titleStrategy?: TitleStrategy;
|
|
2603
2631
|
/**
|
|
@@ -2612,6 +2640,11 @@ export declare class Router {
|
|
|
2612
2640
|
* component first. This behavior is configured by the `RouteReuseStrategy`. In order to reload
|
|
2613
2641
|
* routed components on same url navigation, you need to set `onSameUrlNavigation` to `'reload'`
|
|
2614
2642
|
* _and_ provide a `RouteReuseStrategy` which returns `false` for `shouldReuseRoute`.
|
|
2643
|
+
*
|
|
2644
|
+
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
2645
|
+
* @see `withRouterConfig`
|
|
2646
|
+
* @see `provideRouter`
|
|
2647
|
+
* @see `RouterModule`
|
|
2615
2648
|
*/
|
|
2616
2649
|
onSameUrlNavigation: 'reload' | 'ignore';
|
|
2617
2650
|
/**
|
|
@@ -2622,6 +2655,11 @@ export declare class Router {
|
|
|
2622
2655
|
* for path-less or component-less routes.
|
|
2623
2656
|
* - `'always'` : Inherit parent parameters, data, and resolved data
|
|
2624
2657
|
* for all child routes.
|
|
2658
|
+
*
|
|
2659
|
+
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
2660
|
+
* @see `withRouterConfig`
|
|
2661
|
+
* @see `provideRouter`
|
|
2662
|
+
* @see `RouterModule`
|
|
2625
2663
|
*/
|
|
2626
2664
|
paramsInheritanceStrategy: 'emptyOnly' | 'always';
|
|
2627
2665
|
/**
|
|
@@ -2630,6 +2668,11 @@ export declare class Router {
|
|
|
2630
2668
|
* Set to `'eager'` to update the browser URL at the beginning of navigation.
|
|
2631
2669
|
* You can choose to update early so that, if navigation fails,
|
|
2632
2670
|
* you can show an error message with the URL that failed.
|
|
2671
|
+
*
|
|
2672
|
+
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
2673
|
+
* @see `withRouterConfig`
|
|
2674
|
+
* @see `provideRouter`
|
|
2675
|
+
* @see `RouterModule`
|
|
2633
2676
|
*/
|
|
2634
2677
|
urlUpdateStrategy: 'deferred' | 'eager';
|
|
2635
2678
|
/**
|
|
@@ -2653,13 +2696,25 @@ export declare class Router {
|
|
|
2653
2696
|
*
|
|
2654
2697
|
* The default value is `replace`.
|
|
2655
2698
|
*
|
|
2699
|
+
* @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
|
2700
|
+
* @see `withRouterConfig`
|
|
2701
|
+
* @see `provideRouter`
|
|
2702
|
+
* @see `RouterModule`
|
|
2656
2703
|
*/
|
|
2657
2704
|
canceledNavigationResolution: 'replace' | 'computed';
|
|
2705
|
+
private readonly navigationTransitions;
|
|
2658
2706
|
/**
|
|
2659
2707
|
* Creates the router service.
|
|
2660
2708
|
*/
|
|
2661
|
-
constructor(
|
|
2662
|
-
|
|
2709
|
+
constructor(
|
|
2710
|
+
/** @internal */
|
|
2711
|
+
rootComponentType: Type<any> | null,
|
|
2712
|
+
/** @internal */
|
|
2713
|
+
urlSerializer: UrlSerializer,
|
|
2714
|
+
/** @internal */
|
|
2715
|
+
rootContexts: ChildrenOutletContexts,
|
|
2716
|
+
/** @internal */
|
|
2717
|
+
location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
|
|
2663
2718
|
private setTransition;
|
|
2664
2719
|
/**
|
|
2665
2720
|
* Sets up the location change listener and performs the initial navigation.
|
|
@@ -2826,16 +2881,8 @@ export declare class Router {
|
|
|
2826
2881
|
isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
|
|
2827
2882
|
private removeEmptyProps;
|
|
2828
2883
|
private processNavigations;
|
|
2829
|
-
private scheduleNavigation;
|
|
2830
|
-
private setBrowserUrl;
|
|
2831
|
-
/**
|
|
2832
|
-
* Performs the necessary rollback action to restore the browser URL to the
|
|
2833
|
-
* state before the transition.
|
|
2834
|
-
*/
|
|
2835
|
-
private restoreHistory;
|
|
2836
2884
|
private resetState;
|
|
2837
2885
|
private resetUrlToCurrentUrlTree;
|
|
2838
|
-
private cancelNavigationTransition;
|
|
2839
2886
|
private generateNgRouterState;
|
|
2840
2887
|
static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
|
|
2841
2888
|
static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
|
|
@@ -2964,6 +3011,8 @@ export declare abstract class RouteReuseStrategy {
|
|
|
2964
3011
|
abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
|
2965
3012
|
/** Determines if a route should be reused */
|
|
2966
3013
|
abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
|
3014
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RouteReuseStrategy, never>;
|
|
3015
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RouteReuseStrategy>;
|
|
2967
3016
|
}
|
|
2968
3017
|
|
|
2969
3018
|
/**
|
|
@@ -4002,6 +4051,8 @@ export declare abstract class UrlHandlingStrategy {
|
|
|
4002
4051
|
* Merges the URL fragment with the rest of the URL.
|
|
4003
4052
|
*/
|
|
4004
4053
|
abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
|
|
4054
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlHandlingStrategy, never>;
|
|
4055
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UrlHandlingStrategy>;
|
|
4005
4056
|
}
|
|
4006
4057
|
|
|
4007
4058
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router",
|
|
3
|
-
"version": "15.0.0",
|
|
3
|
+
"version": "15.1.0-next.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": "15.0.0",
|
|
28
|
-
"@angular/common": "15.0.0",
|
|
29
|
-
"@angular/platform-browser": "15.0.0",
|
|
27
|
+
"@angular/core": "15.1.0-next.0",
|
|
28
|
+
"@angular/common": "15.1.0-next.0",
|
|
29
|
+
"@angular/platform-browser": "15.1.0-next.0",
|
|
30
30
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
31
31
|
},
|
|
32
32
|
"ng-update": {
|
package/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0
|
|
2
|
+
* @license Angular v15.1.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -57,13 +57,8 @@ export declare class RouterTestingModule {
|
|
|
57
57
|
* Router setup factory function used for testing.
|
|
58
58
|
*
|
|
59
59
|
* @publicApi
|
|
60
|
+
* @deprecated Use `provideRouter` or `RouterTestingModule` instead.
|
|
60
61
|
*/
|
|
61
62
|
export declare function setupTestingRouter(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], opts?: ExtraOptions | UrlHandlingStrategy | null, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy, titleStrategy?: TitleStrategy): Router;
|
|
62
63
|
|
|
63
|
-
/**
|
|
64
|
-
* Router setup factory function used for testing. Only used internally to keep the factory that's
|
|
65
|
-
* marked as publicApi cleaner (i.e. not having _both_ `TitleStrategy` and `DefaultTitleStrategy`).
|
|
66
|
-
*/
|
|
67
|
-
export declare function setupTestingRouterInternal(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, compiler: Compiler, injector: Injector, routes: Route[][], titleStrategy: TitleStrategy, opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy): Router;
|
|
68
|
-
|
|
69
64
|
export { }
|
package/upgrade/index.d.ts
CHANGED